I have usertable,grouptable and groupuser table.I have written example query to fetch usertable,group and groupusertable to show only one role for an user but need your help writing to fetch multiple roles for an user,
SAy for example USERID=1 FNAME=ANDY and LNAME=ROberts has(role) should be displayed by selecting mulple role in G.name =,TRAINING,IT etc,
On the query it should select one or more values from the column g.name to save for the userprofile.
I couldnt think as im just trying to learn sql.
SELECT T.UID,
T.FNAME ,T.LNAME
,T.EMAIL_ADDRESS
,T.ORIG AS HIERARCHY
,T.BUSINESS_NUMBER
,T.APPROVERNAME
,T.MYOFFICE
,G.NAME AS ROLE
FROM [USER] AS T
INNER JOIN [GROUPUSER] AS UG ON T.CODE = UG.CODE
INNER JOIN [GROUP] AS G ON UG.GROUPID = G.GROUPID
...
Go to the complete details ...