Wondering if someone can show me the correct syntax of a delete
 statement where I want to delete rows from table 'A' where say column1
 of table 'A' = column 1 of table 'B' and column 2 of table 'A' = column
 2 of table 'B'. Working within a procedure and would like to do
 something cleaner than having to create a cursor. I'm sure there
 example but not sure exactly what to search for!
 Thanks,
 JeffThis should give you something to think about.
DELETE FROM A
 WHERE EXISTS
 (SELECT * FROM B
 WHERE A.col1 = B.col1
 AND A.col2 = B.col2)
Roy Harvey
Beacon Falls, CT
On 4 Jan 2007 15:20:55 -0800, "jeff" <jeffa@.telect.com> wrote:
>Wondering if someone can show me the correct syntax of a delete
>statement where I want to delete rows from table 'A' where say column1
>of table 'A' = column 1 of table 'B' and column 2 of table 'A' = column
>2 of table 'B'. Working within a procedure and would like to do
>something cleaner than having to create a cursor. I'm sure there
>example but not sure exactly what to search for!
>Thanks,
>Jeff
Subscribe to:
Post Comments (Atom)
 
No comments:
Post a Comment