Good morning, folks. I'll get right to the point.
I have an MSSQL db with 3 tables. Table A holds users' data with logins and such. Table B holds workstations with machine names, hardware info, etc. Lastly, Table C holds record IDs from A and B in order to keep track of workstations paired to users. Some workstations don't have users yet, some users don't have workstations yet.
HOWEVER, I need to display all users WITH their workstations, but that same result set needs to include users which may not have a workstation associated with them
My current join query works beautifully, but does NOT include users with no workstations associated with them per Table C.
Table A is lan_user
id_user user_name user_login
Table B is lan_ws
id_ws ws_name ws_model operating_syste m
Table C is lan_userws_rel (as in, "relationships" )
id_userws_rel ws_id user_id
select lan_user.*, lan_userws_rel. *, lan_ws.* from lan_user INNER JOIN lan_userws_rel ON lan_user.id_use r = lan_userws_rel. user_id INNER JOIN lan_ws ON lan_ws.id_ws-lan_userws_rel. ws_id
Some additional information:
Workstations can have multiple users and vice versa, but I only really need one pairing in my result set - doesn't matter which one.
I have an MSSQL db with 3 tables. Table A holds users' data with logins and such. Table B holds workstations with machine names, hardware info, etc. Lastly, Table C holds record IDs from A and B in order to keep track of workstations paired to users. Some workstations don't have users yet, some users don't have workstations yet.
HOWEVER, I need to display all users WITH their workstations, but that same result set needs to include users which may not have a workstation associated with them
My current join query works beautifully, but does NOT include users with no workstations associated with them per Table C.
Table A is lan_user
id_user user_name user_login
Table B is lan_ws
id_ws ws_name ws_model operating_syste m
Table C is lan_userws_rel (as in, "relationships" )
id_userws_rel ws_id user_id
select lan_user.*, lan_userws_rel. *, lan_ws.* from lan_user INNER JOIN lan_userws_rel ON lan_user.id_use r = lan_userws_rel. user_id INNER JOIN lan_ws ON lan_ws.id_ws-lan_userws_rel. ws_id
Some additional information:
Workstations can have multiple users and vice versa, but I only really need one pairing in my result set - doesn't matter which one.
Comment