i have 2 tables. imagine first 1 directory, containing lot of files (second table). the second table (files) containing modification_date. now, want select directories , sort them modification date asc (so, latest modification topmost). instead of displaying folder, want display oldest mofified file (so, modification desc, group folder_id) sorting files modification date no problem. my query looks (simplified) this: select f.*, d.* files f left join directories d on f.directory_id = d.id order f.modification_date desc this gives me files in modification order (newest topmost) - now, want group files within folder, see oldest modification (they have "seen" attributes, taking account no big deal, once modification has been seen, second oldest displayed, etc...) how can sort result by modification_date desc , sort modification_date asc after grouping it? example: directories: id | name 1 folder 1 2 folder 2 files id | name | d_...
Comments
Post a Comment