Vin
Vin

Reputation: 169

Select a different value from different row in a single table

how can I get the latest date in mysql?

In the image I just want to get MEMB_N, LAST_M and the latest date which is under id = 655369, 2019-7-29.

img

Upvotes: 2

Views: 35

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1269813

If you are looking for one row, use order by and limit:

select t.*
from t
where t.printdate is not null
order by t.printdate desc
limit 1;

Upvotes: 2

Related Questions