Reputation: 19
SELECT D1.DISTRICT_NAME, E1.EMP_FNAME, E1.EMP_LNAME, T1.TAX_YEAR, T1.DATE_LAST_CALC
FROM DISTRICT D1
JOIN EMPLOYEE E1 ON ????s
JOIN TOTAL PAB T1 ON ????s
I need to use a join operator but I don't know how to use it or what to put where I have the ????s. And do I need to make 2 other from statements for the other ones like TOTAL_PAB and EMPLOYEE? Thanks
Upvotes: 1
Views: 55
Reputation: 17394
Your query should look something like this
SELECT D1.DISTRICT_NAME, E1.EMP_FNAME, E1.EMP_LNAME, T1.TAX_YEAR, T1.DATE_LAST_CALC
FROM DISTRICT D1
JOIN EMPLOYEE E1 ON D1.PrimarKey = E1.ForeignKey
JOIN TOTAL PAB T1 ON D1|E1.PrimaryKey=T1.ForeignKey
You pick Primary Key from one table and join it with Foreignkey of the other. You can also join on no-primary keys but that will give you a lot of duplicates which won't want.
Upvotes: 1