Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi,
I have one table as mentioned below:

NAME CLASS FLAG
A YES 0
A NO 1
B YES 1
B NO 1
C NO 0

I need all name CONDITION 1 when class=YES AND FLAG=0

CONDITION 2 when class=No and (flag=1 or flag=0)
Posted
Updated 17-Jul-15 3:21am
v2
Comments
F-ES Sitecore 17-Jul-15 9:21am    
What have you tried so far? Have you google for the syntax of a SELECT statement? Or multiple conditions on a SELECT?

1 solution

What you describe seems very trivial.
SQL
SELECT *
FROM table1 
WHERE class='YES' AND falg = 0
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900