Hello guys,
I have a question about a sql query so I have these 5 tables
there are 5 tables
Room, RommRent, DBSource, RoomType, RoomRealCode
SELECT Room.idCode, RoomRent.Label, MAX(chambrerent.[TimeStamp]), RoomRent.TreeID
FROM RoomRent INNER JOIN
DBsource ON RoomRent.DBSource_ID = DBSource.DBSource_ID RIGHT OUTER JOIN Room LEFT OUTER JOIN
RoomRealCode ON RoomRealCode.RoomReal_ID = Room.RoomReal_ID ON DBSource.DBSource_ID = T_RoomRealCode.DBSource_ID
GROUP BY Room.idCode, DBSource.sourceName, RoomRent.Label, RoomRent.[TimeStamp], DBSource.sourceName,
RoomRent.RoomType, RoomRent.TreeID
HAVING (Room.idCode = 'Royal3D')
ORDER BY MAX(RoomRent.[TimeStamp]) DESC
IDCODE LABEL TIMESTAMP TREEID
Royal3D Suite 2006-05-30 12:21:17.457 242827
Royal3D 3RM 2006-05-30 12:21:17.457 242827
Royal3D 3FM 2006-05-30 12:21:17.457 242827
Royal3D Suite 2006-04-25 14:40:05.263 204750
Royal3D 3FM 2006-04-25 14:40:05.263 204750
Royal3D Simple 2006-04-11 14:18:03.000 30000
I would like to obtain, the max of timestamp and with the same TREEID
IDCODE LABEL TIMESTAMP TREEID
Royal3D Suite 2006-05-30 12:21:17.457 242827
Royal3D 3RM 2006-05-30 12:21:17.457 242827
Royal3D 3FM 2006-05-30 12:21:17.457 242827
How can I send up this condition?
Ina
I have a question about a sql query so I have these 5 tables
there are 5 tables
Room, RommRent, DBSource, RoomType, RoomRealCode
SELECT Room.idCode, RoomRent.Label, MAX(chambrerent.[TimeStamp]), RoomRent.TreeID
FROM RoomRent INNER JOIN
DBsource ON RoomRent.DBSource_ID = DBSource.DBSource_ID RIGHT OUTER JOIN Room LEFT OUTER JOIN
RoomRealCode ON RoomRealCode.RoomReal_ID = Room.RoomReal_ID ON DBSource.DBSource_ID = T_RoomRealCode.DBSource_ID
GROUP BY Room.idCode, DBSource.sourceName, RoomRent.Label, RoomRent.[TimeStamp], DBSource.sourceName,
RoomRent.RoomType, RoomRent.TreeID
HAVING (Room.idCode = 'Royal3D')
ORDER BY MAX(RoomRent.[TimeStamp]) DESC
IDCODE LABEL TIMESTAMP TREEID
Royal3D Suite 2006-05-30 12:21:17.457 242827
Royal3D 3RM 2006-05-30 12:21:17.457 242827
Royal3D 3FM 2006-05-30 12:21:17.457 242827
Royal3D Suite 2006-04-25 14:40:05.263 204750
Royal3D 3FM 2006-04-25 14:40:05.263 204750
Royal3D Simple 2006-04-11 14:18:03.000 30000
I would like to obtain, the max of timestamp and with the same TREEID
IDCODE LABEL TIMESTAMP TREEID
Royal3D Suite 2006-05-30 12:21:17.457 242827
Royal3D 3RM 2006-05-30 12:21:17.457 242827
Royal3D 3FM 2006-05-30 12:21:17.457 242827
How can I send up this condition?
Ina