How do I eliminate duplicate rows in this query I have tried

How do I eliminate duplicate rows in this query? I have tried to insert DISTINCT but it is not recognized.

SELECT CONCAT(CONCAT(student.lastname,\', \'),student.firstname) AS \"Student\", CONCAT(CONCAT(faculty.lname,\', \'),faculty.fname) AS \"Committee member\", committee.ischair AS \"Chair?\" FROM student, committee, faculty order by lastname;

Solution

Just use DISTINCT after the SELECT keyword to eliminate duplicate rows.

You can use joins to accomplish the desired result effectively.

How do I eliminate duplicate rows in this query? I have tried to insert DISTINCT but it is not recognized. SELECT CONCAT(CONCAT(student.lastname,\', \'),student

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site