hI every body i have a "little " problem with a hql code . i want to "traslate" a sql code to hql
Code:
SELECT
ID ID_JOB,
SEQ ID,
(SELECT DISTINCT VALUE JOB_GROUP FROM DC_LOGGING WHERE ID = AA.ID AND SEQ = AA.SEQ AND POS = AA.POS AND NAME = 'JOB_GROUP') JOB_GROUP,
(SELECT DISTINCT VALUE JOB_NAME FROM DC_LOGGING WHERE ID = AA.ID AND SEQ = AA.SEQ AND POS = AA.POS AND NAME = 'JOB_NAME') JOB_NAME,
AGENT HOST,
TIME START_DATE,
(SELECT DISTINCT VALUE RETRY FROM DC_LOGGING WHERE ID = AA.ID AND SEQ = AA.SEQ AND POS = AA.POS AND NAME = 'RETRY') RETRY,
TYPE,
TYPE_DESCRIPTION,
ERR ERROR,
ERROR_DESCRIPTION,
(SELECT DISTINCT VALUE MESSAGE FROM DC_LOGGING WHERE ID = AA.ID AND SEQ = AA.SEQ AND POS = AA.POS AND NAME = 'MESSAGE') MESSAGE
FROM
(SELECT DISTINCT A.ID, A.SEQ, A.POS, A.AGENT, A.TIME, A.TYPE, T.DESCRIPTION TYPE_DESCRIPTION, ERR,
E.DESCRIPTION ERROR_DESCRIPTION FROM DC_LOGGING A, DC_LOG_TYPE T, DC_ERRORS E
WHERE A.ID = 66656 AND A.POS = 'T' AND A.TYPE = T.ID_LOG_TYPE AND A.ERR = E.ID) AA ORDER BY SEQ
the problem is ...
Code:
....
FROM
(SELECT DISTINCT A.ID, A.SEQ, A.POS, A.AGENT, A.TIME, A.TYPE, T.DESCRIPTION TYPE_DESCRIPTION, ERR,
E.DESCRIPTION ERROR_DESCRIPTION FROM DC_LOGGING A, DC_LOG_TYPE T, DC_ERRORS E
WHERE A.ID = 66656 AND A.POS = 'T' AND A.TYPE = T.ID_LOG_TYPE AND A.ERR = E.ID) AA ORDER BY SEQ
i dont know how to do "(select from(select...)"
thanks...