vendredi 13 décembre 2019

How to get the latest record in laravel of diffrent users?

id  user_id  name    qty     datetime
--- ---------  ----    ----    -----------
1   1           a      5       2019-12-01 12:26:01
2   2           b      3       2019-12-13 12:26:02
3   1           c      4       2019-12-13 12:26:03
4   2           a      2       2019-12-25 12:26:04
5   1           c      2       2019-12-21 12:26:06

i Want the this data

id  user_id  name    qty     datetime
--- ---------  ----    ----    -----------
5   1           c      2       2019-12-21 12:26:06
4   2           a      2       2019-12-25 12:26:04

using laravel and also if possible then what will be the sql query for it



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire