我愿做这样的事情:如果MySQL的INSERT语句
IF ((19, 13) NOT IN (select idUtente, IdLezione from partecipa)) THEN
insert into partecipa
(IdUtente, IdLezione,
IdAbbonamento,
utente,
prova, riserva)
values(
19, 13,
(select idAbbonamento from abbonamento where attivo=1 and idUtente=19),
(select concat(u.nome," ",u.cognome) from abbonamento as a, utente as u where a.attivo=1 and a.idUtente=u.idUtente and u.idUtente=19),
0, 0)
end if;
,但有一个错误的语法
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 'IF ((19, 13) NOT IN (select idUtente, IdLezione from partecipa)) THEN insert int' at line 1 0.000 sec
和互联网上我找不到任何解决方案。有人可以帮助我吗?
什么是错误讯息? – tuxtimo 2013-02-19 14:36:10