January 30, 2008 at 6:48 am
Dear All,
I have a two table Users && Roles
Roles contains following columns
Roleid, Rolename,InboxEnabled
Users contains
Userid,Region,Branchid,Roles
The Data in the Roles Table is
Admin -Admin -y
Enduser-EndUser-n
Dev -Developer-y
Network-Network-y
The data in the users table is
Ravi-North-Delhi-Admin,Dev,Network,
Raju-North-Delhi-Dev,Enduser,
select Roleid from Roles where Inboxenabled ='y' will return me Admin and Dev roles
when i pass this query as a condition to users table i have to get output as Ravi
Anyone please help me to solve this query
January 30, 2008 at 8:19 am
select Roleid from Roles where Inboxenabled ='y' will return me Admin and Dev roles
According to the data you supplied, the query should return Admin, Developer and Network. In the 'WHERE' clause, besides Inboxenabled = 'Y', is there anything else ?
January 30, 2008 at 8:23 am
It's not quite clear what you want. your query doesn't reference users at all.
This almost seems like homework. Please make an attempt against users and show what is confusing or not working and we're happy to help.
January 30, 2008 at 8:23 am
In the Roles table, 'Developer' has a 'Y' in the InboxEnabled field.
So if you select user from the Users table where InboxEnabled = 'Y' in the Roles table, how come only 'Ravi' returned? User 'Raju' has 'Developer' too.
January 30, 2008 at 11:30 am
Please don't cross post. It wastes people's time.
Please direct replies to the following thread:
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply