View previous topic :: View next topic
|
Author |
Message |
b4uthammi Warnings : 2 New User
Joined: 21 Feb 2005 Posts: 14 Location: hyderabad
|
|
|
|
hai,
i have 2 tables. table 1 have the column wch-code and table2 have wcr-code.
my reqiurement is wcr-code could not be deleted if it appears in the table1(wch-code) .how can i implement the above logic.
thanks in advance
WARNING: TITLE EDITED |
|
Back to top |
|
|
stly Warnings : 1 New User
Joined: 25 Jul 2005 Posts: 93
|
|
|
|
DELETE FROM TABLE2 WHERE TABLE2.WCHCODE NOT IN(SELECT WCRCODE FROM TABLE2) |
|
Back to top |
|
|
parikshit123
Active User
Joined: 01 Jul 2005 Posts: 269 Location: India
|
|
|
|
Hi,
You can use "IF EXIST" clause in your SQL statement as well. |
|
Back to top |
|
|
|