Click here to Skip to main content
15,921,837 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
HERE is value of table
CODE A B

0001 True False
0002 False False
0003 False True
0004 True True

I want result as following(A=B=False;A=B=True;AND A=False B=True

CODE A B

0002 False False
0003 False True
0004 True True


Is it possible....Help me
Posted

1 solution

That also means you want to exclude "A=True B=False", In this case you can try as below Query.

SQL
Select * from TableName where A='False' and B='False'
Union
Select * from TableName where A='True' and B='True'
Union
Select * from TableName where A='False' and B='True';
 
Share this answer
 
v2
Comments
Uday P.Singh 30-Aug-11 6:15am    
this should work my 5!
RaisKazi 30-Aug-11 6:18am    
Thanks Uday.
himanshu034 30-Aug-11 6:26am    
Thank You RaisKazi
RaisKazi 30-Aug-11 6:31am    
You are Welcome, But could not understand 1 * for "Accepted Answer" :).
himanshu034 30-Aug-11 6:40am    
oh!!! because of double click in excitment

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