SQL Server Forums
Profile | Register | 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?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

akpaga
Constraint Violating Yak Guru

USA
311 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
2869 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
311 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
2869 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  
 New 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.05 seconds. Powered By: Snitz Forums 2000