FRIHOSTFORUMSSEARCHFAQTOSBLOGSCOMPETITIONS
You are invited to Log in or Register a free 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.
Related topics
SQL Server 2000 and MYSQL, pls help me.
Microsoft Visual Studio 2005
Visual Studio 2005 and SQL Server 2005 Express, Free?
Is it a Virus?!?!
VB.NET and SQL Server
xp and microsoft sql server 2005 enterprise edition
What's New in Pocket Internet Explorer
Ill deal with your HijackThis logs for you.
Converting Access database to SQL server 2005
PHP and SQL Server
Microsoft SQL & PHP blog
DotNetNuke - CMS Microsoft based mas Grátis
Problem with my SQL Server (not Frihost)
Move database to different SQL server
Reply to topic    Frihost Forum Index -> Scripting -> Others

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