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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Remove records based on two column values?
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

akpaga
Constraint Violating Yak Guru

USA
331 Posts

Posted - 10/11/2012 :  10:51:20  Show Profile  Reply with Quote
Hi friends ,

I have a table Customer and I would like to remove records from my select query when Customer_type is 'Regular' and Result is 'temp'.

Example
Customername,Customer_type,Result
john,Regular,temp
James,Regular,perm
Jack,Regular,temp

So from above data i just need James record..How is this done..thank you

jimf
Flowing Fount of Yak Knowledge

USA
2875 Posts

Posted - 10/11/2012 :  11:33:51  Show Profile  Reply with Quote
SELECT *
FROM yourTable
WHERE NOT (Customer_type = 'regular' and Result = 'temp')

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page

akpaga
Constraint Violating Yak Guru

USA
331 Posts

Posted - 10/11/2012 :  11:35:10  Show Profile  Reply with Quote
Thank you Jim
Go to Top of Page

jimf
Flowing Fount of Yak Knowledge

USA
2875 Posts

Posted - 10/11/2012 :  12:02:04  Show Profile  Reply with Quote
You're welcome.

Jim

Everyday I learn something that somebody else already knew
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.36 seconds. Powered By: Snitz Forums 2000