Click here to Skip to main content
15,891,733 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to join three table.
I want to select the department id column from the department table of the person.If I want to select the status id from the staff table according to those personid and departmentid.


I want to select columns from tables.
PERSON-->PERSONID (PERSONID,DEPARTMENTID,STATUSID)


DEPARTMENT --> DEPARTMENTID (PERSONID,DEPARTMENTID)


STATUS --> STATUSID (DEPARTMENTID,STATUSID)

What I have tried:

SELECT ID,DEPARTMENTID,STATUSID FROM PERSON WHERE CLASSID=1

SELECT DEPARTMENTID FROM  DEPARTMENT WHERE (SELECT ID,DEPARTMENTID FROM PERSON)

SELECT STATUSID FROM STATUS WHERE (SELECT DEPARTMENTID,STATUSID FROM DEPARTMENT)
Posted
Updated 2-Jun-20 8:03am

1 solution

Start here:
Perform inner joins (LINQ in C#) | Microsoft Docs[^]
Perform left outer joins (LINQ in C#) | Microsoft Docs[^]

When you get stuck, come back here, provide your code, describe your issue and wait for response.
 
Share this answer
 

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