Dear All,
 
I have 2 tables Table1 and Table2. In Table1 rowid is primary key and in
Table2 rowid is primary key as well as foreign key (referring to rowid in
Table1).
 
There are several other columns in Table1, but Table2 has only one col -
rowid.
 
I want to insert rowid into Table2 conditionally:
 
    insert into Table2 (rowid) select T1.rowid from Table1 T1, Table2 T2
where T1.somecolumn = 'some condition' 
 
But I want to insert only those rowid values which do not exist in T2.
 
Please help.
 
I am using MySQL version 4.1.14-standard-log. Hence subqueries are not a
solution.
 
Thanks,
Ravi.

Reply via email to