--- On Tue, 12/11/07, Pau Marc Munoz Torres <paumarc@xxxxxxxxx> wrote: > Thanks, i'll test it tomorrow OOPS, I just noticed a mistake. INSERT INTO SP SELECT a, b FROM ( VALUES ( 'cesp', 'sp' )) AS tmp( a, b ) LEFT JOIN Sp ON (Sp.col1,Sp.col2)=(tmp.a,tmp.b) WHERE (Sp.col1,Sp.col2) IS NULL; I forgot the parentheses that the FROM clause requires when using the VALUES predicate. Also remember that this only works in PostgreSQL versions >= 8.2. Regards, Richard Broersma Jr. ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your message can get through to the mailing list cleanly