Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 help in query

Author  Topic 

inbs
Aged Yak Warrior

860 Posts

Posted - 2014-09-30 : 06:37:45
i have this table

id name
1 4
1 5
1 33
2 1
2 66


i want to delete where id=1 except id=1 and name =33

i mean ,i want get this table

id name
1 33
2 1
2 66


harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2014-09-30 : 07:05:39
delete from someTable where id = 1 and name <> 33

Harsh Athalye
http://in.linkedin.com/in/harshathalye/
Go to Top of Page

mhorseman
Starting Member

44 Posts

Posted - 2014-09-30 : 07:05:52
I think

delete table where id = 1 and name <> 33

should do it.

Mark
Go to Top of Page
   

- Advertisement -