0
我使用以下查詢從mysql表中檢索信息。將MySQL查詢轉換爲Informix
SELECT ACCESS_TOKEN,
AUTHZ_USER,
TOKEN_SCOPE,
TOKEN_STATE,
REFRESH_TOKEN_TIME_CREATED,
REFRESH_TOKEN_VALIDITY_PERIOD,
IDN_OAUTH2_ACCESS_TOKEN_SELECTED.TOKEN_ID
FROM
(SELECT ACCESS_TOKEN,
AUTHZ_USER,
TOKEN_STATE,
REFRESH_TOKEN_TIME_CREATED,
REFRESH_TOKEN_VALIDITY_PERIOD,
TOKEN_ID
FROM IDN_OAUTH2_ACCESS_TOKEN
WHERE CONSUMER_KEY = ""
AND REFRESH_TOKEN = ""
ORDER BY TIME_CREATED DESC
LIMIT 1) AS IDN_OAUTH2_ACCESS_TOKEN_SELECTED
JOIN IDN_OAUTH2_SCOPE_ASSOCIATION
WHERE IDN_OAUTH2_ACCESS_TOKEN_SELECTED.TOKEN_ID =
IDN_OAUTH2_SCOPE_ASSOCIATION.TOKEN_ID;
如何在具有相同表的Informix數據庫中獲得相同的結果?
ANSI SQL需要對每個JOIN,但在這裏,你有一個相反。只要將最後的WHERE更改爲ON即可。 – jarlh
它的工作,添加了一個答案。 –