SELECT * FROM `qpandn` WHERE ID=3 and USER in (select distinct USER from `qpandn` group by USER having (PNDNADAY=MAX(PNDNADAY))) order by USER