Better would be
Insert into tablea(ida, value1a)
Select idb, value1b
        from tableb
        where idb not in(select ida from tablea);

Woody
from his pda

-----Original Message-----
From: Lothar Behrens <[EMAIL PROTECTED]>
Sent: Saturday, May 10, 2008 2:23 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] CASE WHEN sample ?

Hi,

I am searching for a sample that uses the case when expression.
I like to insert values into a table when these values are not in that 
table before.

My tries to read, understand and try the documentation of expressions 
failed.

Executing this statemen twice creates two rows:

replace into anwendungen (name) values ('lbDMF Manager')

This is pseudo code:

if not exsists (select id from mytable where name = 'some name')
        insert into mytable (name) values ('some name')

Is this possible ?

Thanks

Lothar

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to