Click here to Skip to main content
15,889,034 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,

First of all thank you for your help.

I have a question to ask.

I have a data table with 5 columns in it.
company-------- user:--------- description------- group ------- shared
companyA------- userA ------- This is gA ------- A ------------- No
companyB------- userB ------- This is gB ------- B ------------- yes

My query looks like this
SQL
select * FROM t_groups WHERE User_Name='userA' and Company_Name='CompanyA'

But i also want to return the groups from other users which are shared.

So i want to return the above queries groups but also the groups from other users that have been shared.
Posted
Updated 30-Oct-12 4:22am
v3

1 solution

Just change your WHERE Cause:
C#
select * FROM t_groups WHERE (User_Name='userA' and Company_Name='CompanyA') OR shared
 
Share this answer
 
Comments
mrDivan 30-Oct-12 10:42am    
Thank you it worked
OriginalGriff 30-Oct-12 10:55am    
You're welcome!

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