Results 1 to 2 of 2

Thread: selct?

  1. #1
    Join Date
    Jul 2003
    Posts
    421

    Unhappy selct?

    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?

  2. #2
    Join Date
    Sep 2011
    Posts
    4
    Try this:
    PHP Code:
    select distinct(t1.id), t1.student_idt1.status from table1 as t1table1 as t2
            where t1
    .student_id t2.student_id and t1.status != t2.status
        order by t1
    .id 
    where table1 - your table name

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •