I have this data
UserId   LoginTime     Machine
100       1.1.2022        A
100       1.2.2022        B
101       1.3.2022        C
101       1.4.2022        D
101       1.5.2022        E
and I need this output by sql query
UserId     LoginTime    Machine
100         1.2.2022       B
101         1.5.2022       E
The latest records grouping by UserId and including Machine info
I tried group by and max functions but I need Machine info and when I try group by, results doesn't show up as single, because machine info is different. Could you help me with this query?
 
     
    