Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Using GROUP BY in MySQL Join Table

SELECT q.* FROM (
SELECT patient . * , visit.uid AS visit_uid
FROM patient
LEFT JOIN visit ON patient.uid = visit.patient_id
ORDER BY visit_uid DESC 

) q GROUP BY q.uid ORDER BY q.visit_uid DESC 

LIMIT 0 , 10
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Using #GROUP #BY #MySQL #Join #Table
ADD COMMENT
Topic
Name
7+7 =