SELECT table1.indexObject,
table1.ObjectNames,
table2.measureCommFromTab,
table3.izmerenije,
table3.datetimeMess
FROM (table3 INNER JOIN table2 ON table3.measureComm_id = table2.keyID)
INNER JOIN table1 ON table3.indexObjectsTab_id = table1.keyID
WHERE table2.keyID>0 AND table3.datetimeMess =
(SELECT Max(table3.datetimeMess) FROM table3 WHERE table3.indexObjectsTab_id = table1.keyID GROUP BY table3.indexObjectsTab_id)
ORDER BY table1.indexObject;
SELECT Table1.indexObject,
Table1.ObjectNames,
table2.measureCommFromTab,
table3.izmerenije, max(table3.datetimeMess)
FROM ((Table3 INNER JOIN table2 ON (table2.keyID = table3.measureComm_id))
INNER JOIN table1 ON (Table1.keyID = table3.indexObjectsTab_id))
WHERE table2.keyID>0 And indexObject In (55296, 55226)
GROUP BY table2.measureCommFromTab, Table1.indexObject, Table1.ObjectNames, table3.izmerenije
ORDER BY Table1.indexObject
SELECT Table1.indexObject,
Table1.ObjectNames,
table2.measureCommFromTab,
table3.izmerenije, max(table3.datetimeMess)
FROM ((Table3 INNER JOIN table2 ON (table2.keyID = table3.measureComm_id))
INNER JOIN table1 ON (Table1.keyID = table3.indexObjectsTab_id))
WHERE table2.keyID>0 And indexObject In (55296, 55226)
GROUP BY table2.measureCommFromTab, Table1.indexObject
ORDER BY Table1.indexObject