|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Need help with multi-table delete query
Hi,
I am trying to delete entries in a table, where the condition is only stored in another table. How do I achieve this? Here is the wishful query: delete table_1 where table_2.item = 'this' AND table_2.info = table_1.info; Of course this doesn't work, but it's what I need. Please help! |
|
#2
|
|||
|
|||
|
Ok, I came up with something, and it seems to work:
delete from table_1 where table1_info in (select info from table_2 where item = 'this') |
|
#3
|
||||
|
||||
|
Why didnt u post this in the General Database forum?
|
|
#4
|
|||
|
|||
|
sorry, thought I WAS in general DB forum.
|
![]() |
| Viewing: Dev Shed Forums > Other > Dev Shed Lounge > Need help with multi-table delete query |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|