0

SQL inner joins

Iā€™m having trouble figuring out exactly how to word the queries. Weā€™re doing inner joins and I donā€™t have error in it but it wonā€™t give me any results so thereā€™s something Iā€™m not getting.. this is the question and my query.. ā€œWrite the SQL statement that reports the employee is, employee full name and their job description. Sort the results by job description, employee last name, and then employee first name.ā€ USE pubs SELECT employee.emp_id, employee.fname, employee.lname as EmployeeID, jobs.job_desc as JobDesc FROM employee INNER JOIN jobs ON employee.emp_id = jobs.job_desc ORDER BY JobDesc, employee.lname

3rd Nov 2020, 10:30 PM
Jay Elle
1 Answer
+ 1
The ON condition is wrong. Jobs table should have some column like emp_id, so should be ON employee.emp_id = jobs.emp_id. Just a guess, for better advice you have to show the table structure
3rd Nov 2020, 11:30 PM
Benjamin JĆ¼rgens
Benjamin JĆ¼rgens - avatar