Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use Case When, Like operator, Where clause

Status
Not open for further replies.

murthy51162

Programmer
May 16, 2007
2
IN
Hi
I want to use the Like Operator and Case When operator in Where clause. The situation is like this :

I have a table with Sales_Team_name and Channel. The channel include A, B, C and Sales_Team_name include X, Y, Z. All the sales_team_name can be in all the channels. My requirement is I want all the sales_Team_name of channel A, B but I do not want sales_team_name Z in channel C.

Hope the requirement is clear. Please help.
 
How about:
Code:
SELECT channel, sales_team_name
FROM tablename
WHERE channel IN ('A', 'B')

-SQLBill

Posting advice: FAQ481-4875
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top