mysql - Selecting newest id result where column is relation -
i have code below select profile_picture column relation userid 129, how ever tried adding id max , realised rules out selecting rows contain profile_picture.
i need query select media relation profile_picture , id = 129 , max id profile_picture
select * media userid = 129 , relation = 'profile_picture' , id=( select max(id) media.relation )
from limited information provided, guessing have right; need move (except id part of course) subquery. (and fix media.relation
media
guess).
select * media id = ( select max(id) media userid = 129 , relation = 'profile_picture' );
Comments
Post a Comment