MYSQL inner join

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Nuthan
    New Member
    • Sep 2011
    • 1

    MYSQL inner join

    I have a problem where in i wanna use inner join the table and execute these individual query in a single query.
    PLEASE Advice!!!

    Code:
    //latest entry
    SELECT MAX( time )
    FROM jos_porsche_group_reading_task
    WHERE q_s_id = '86'
    AND group_content_id = '1'
    
    //latest entry with score<>0
    SELECT MAX( time )
    FROM jos_porsche_group_reading_task
    WHERE q_s_id = '86'
    AND group_content_id = '1'
    AND score <>0
    
    //latest entry with filename<>''
    SELECT MAX( time )
    FROM jos_porsche_group_reading_task
    WHERE student_id = '86'
    AND group_content_id = '1'
    AND filename<>''
    Last edited by Niheel; Sep 29 '11, 03:08 AM.
  • patjones
    Recognized Expert Contributor
    • Jun 2007
    • 931

    #2
    You're just dealing with one table. One possibility is to write these separate queries as sub-queries and JOIN them.

    Comment

    Working...