sql - How to use Select query with MAX Date? -
sql - How to use Select query with MAX Date? -
i trying latest date database.but getting query error on 'reservation.entrydate'
select rooms.roomtitle,rooms.isreserved,reservation.checkintime,reservation.checkouttime reservation,rooms inner bring together (select reservation.roomid, max(reservation.entrydate) maxdatetime reservation grouping reservation.roomid) groupedtt on rooms.roomid = groupedtt.roomid , reservation.entrydate = groupedtt.maxdatetime what doing wrong?
don't mix implicit , explicit bring together syntax
select ro.roomtitle, ro.isreserved, res.checkintime, res.checkouttime reservation res bring together rooms ro on ro.roomid = res.roomid bring together ( select roomid, max(entrydate) maxdatetime reservation grouping roomid ) groupedtt on ro.roomid = groupedtt.roomid , res.entrydate = groupedtt.maxdatetime sql
Comments
Post a Comment