2010/5/10 Ian Barwick <barwick@gmail.com>:
> SELECT ov.object_id
> FROM object_version ov
> WHERE ov.object_id = 1
> AND ov.version ='0
> AND ov.object_status_id = (
> SELECT MAX(ov1.object_status_id)
> FROM object_version ov1
> WHERE ov1.object_id=ov.object_id
> AND ov1.version = ov.version
> AND ov1.lang = ov.lang
> )
> AND ov.lang = 'en';
Apologies, slight c&p error; correct version of query:
SELECT ov.object_id FROM object_version ov WHERE ov.object_id = 1 AND ov.version =0 AND ov.object_status_id = (
SELECTMAX(ov1.object_status_id) FROM object_version ov1 WHERE ov1.object_id=ov.object_id AND ov1.version =
ov.version AND ov1.lang = ov.lang ) AND ov.lang = 'en';
FWIW the test case works fine in 8.4.3
Ian Barwick