Re: [sqlite] delete/update joins
This may be better: delete from table1 where rowid in ( select table1.rowid from table2 where table1.id = table2.id and table2.otherid = 1 ); --- Joe Wilson <[EMAIL PROTECTED]> wrote: > How about: > > delete from table1 where id in ( >select table1.id > from table1, table2 > where table1.id = table2.id > and table2.otherid = 1 > ); > > or this: > > delete from table1 where rowid in ( >select table1.rowid > from table1, table2 > where table1.id = table2.id > and table2.otherid = 1 > ); > > Not sure how it could be done with a trigger. > > --- Curtis Bruneau <[EMAIL PROTECTED]> wrote: > > Are there any plans to support joins on delete? it can get quite long to > > do it the manual way when you have a lot of relational data. > > > > DELETE FROM table > > INNER JOIN table2 > > ON table.id = table2.id > > WHERE table2.otherid = 1 > > > > This works in standard sql, I realise it may be difficult to implement > > just wondering if it was overlooked. The same goes for joins on UPDATE > > which don't appear to be supported. I should probably attempt to use > > triggers to solve this issue. Get easy, one-click access to your favorites. Make Yahoo! your homepage. http://www.yahoo.com/r/hs - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] delete/update joins
How about: delete from table1 where id in ( select table1.id from table1, table2 where table1.id = table2.id and table2.otherid = 1 ); or this: delete from table1 where rowid in ( select table1.rowid from table1, table2 where table1.id = table2.id and table2.otherid = 1 ); Not sure how it could be done with a trigger. --- Curtis Bruneau <[EMAIL PROTECTED]> wrote: > Are there any plans to support joins on delete? it can get quite long to > do it the manual way when you have a lot of relational data. > > DELETE FROM table > INNER JOIN table2 > ON table.id = table2.id > WHERE table2.otherid = 1 > > This works in standard sql, I realise it may be difficult to implement > just wondering if it was overlooked. The same goes for joins on UPDATE > which don't appear to be supported. I should probably attempt to use > triggers to solve this issue. Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs - To unsubscribe, send email to [EMAIL PROTECTED] -
[sqlite] delete/update joins
Are there any plans to support joins on delete? it can get quite long to do it the manual way when you have a lot of relational data. DELETE FROM table INNER JOIN table2 ON table.id = table2.id WHERE table2.otherid = 1 This works in standard sql, I realise it may be difficult to implement just wondering if it was overlooked. The same goes for joins on UPDATE which don't appear to be supported. I should probably attempt to use triggers to solve this issue. Curtis B - To unsubscribe, send email to [EMAIL PROTECTED] -