Click here to Skip to main content
13,353,462 members (37,385 online)
Rate this:
 
Please Sign up or sign in to vote.
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 17-Jul-15 4:03am
Updated 17-Jul-15 4: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

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

What you describe seems very trivial.
SELECT *
FROM table1 
WHERE class='YES' AND falg = 0
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web01 | 2.8.180111.1 | Last Updated 17 Jul 2015
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100