好吧,我只想插入数据,如果它不存在于表中,如果它存在则不需要做任何事情
insert into colleges (Id, Name, CreatedOn) values("20", "ASIET", "2017-12-14
06:44:32") where not exists (select id from colleges where name = "ASIET")
我收到了错误
Error Code: 1064. You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to use
near 'where not exists (select id from colleges where name = "ASIET")' at
line 1
并提前感谢您的帮助