需要幫助... 如何將此SQL查詢HQL翻譯: select "row" from (select rownum as "row", globalId from globalTable where valid='T') where globalId = "g123";
globalTable :
globalId _ valid
g000 _ T
g111 _ F
g222 _ T
我wondring爲什麼這不起作用: SELECT
(
SELECT COALESCE(MAX(a.LaufNr),0) + TBL.Rownum
FROM schemaB.PersonRelatedTbl A
WHERE A.Persid = Tbl.Persid
)
, Tbl.Some_Other_Attributs
FROM schema
>SELECT instmax
FROM
(SELECT instmax,
rownum r
FROM
(SELECT * FROM pswlinstmax ORDER BY instmax DESC NULLS LAST
)
)
WHERE r = 2;
INSTMAX
-------
1049
>SELECT instmax