I have table( mysql) some columns are id student_id and status(Yes/No) , if I want to find out those records which have same studentId but different status
What should I do?
select distinct(t1.id), t1.student_id, t1.status from table1 as t1, table1 as t2
where t1.student_id = t2.student_id and t1.status != t2.status
order by t1.id