0

I have two tables

Table A has usr_id , usr_name , usr_status [1 or 0]

Table B has id , usr_id,tracked_date [Each user can track multiple time]

Need to get last track of each user has usr_status = 1

How to achieve through mysql query ?

Tried like:

SELECT 
    *
FROM
    tableb b
        LEFT JOIN
    tablea a ON a.usr_id = b.usr_id
GROUP BY a.usr_id

Please advice ?

vignesh.D
  • 766
  • 4
  • 18

0 Answers0