FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

MIcrosoft SQL Server- Help for deleting records

 


sathiyasri
Hai Everybody,

I have 20 records in table A which has columns C1,C2 as PK
and table B has the same structure and has 5 records only.

I want to delete the records in A which are in B.

what is the query for doing this?
eepman
Code:

delete from table1 where c1 = any(select c1 from table2);


Hope that works for you.
Reply to topic    Frihost Forum Index -> Scripting -> Others

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.