我想測試一個查詢並得到ORA-00907
錯誤。我相信這個錯誤是由於我用於RUN.RN_RUN_ID
的內部查詢。
內部查詢本身工作正常,我給內部查詢的結果,外部查詢工作正常。任何洞察我做錯了什麼,將不勝感激。ORDER BY與內部查詢,給ORA-00907缺少右括號
Select
RELEASES.REL_NAME AS RELEASE_NAME,
RELEASE_CYCLES.RCYC_NAME AS CYCLE_NAME,
TESTCYCL.TC_TESTCYCL_ID AS TEST_INSTANCE_ID,
TEST.TS_NAME AS TEST_CASE_NAME,
TEST.TS_USER_26 AS TEST_POST_CONDITIONS,
TEST.TS_USER_25 AS TEST_PRE_CONDITIONS,
TEST.TS_TEST_ID AS TEST_CASE_ID,
TEST.TS_DESCRIPTION AS TEST_CASE_DESCRIPTION,
TESTCYCL.TC_STATUS AS TEST_ACTUAL_RESULTS,
TEST.TS_DEV_COMMENTS AS TEST_CASE_COMMENTS,
TEST.TS_RESPONSIBLE AS TEST_CASE_AUTHOR,
TEST.TS_CREATION_DATE AS TEST_CASE_CREATION_DATE,
TESTCYCL.TC_EXEC_DATE AS EXECUTION_DATE,
TESTCYCL.TC_EXEC_TIME AS EXECUTION_TIME,
TESTCYCL.TC_ACTUAL_TESTER AS EXECUTED_BY,
STEP.ST_ID AS STEP_ID,
STEP.ST_STEP_NAME AS STEP_NUMBER,
STEP.ST_DESCRIPTION AS STEP_DESCRIPTION,
STEP.ST_EXPECTED AS EXPECTED_RESULTS,
STEP.ST_ACTUAL AS ACTUAL_RESULTS,
STEP.ST_USER_07 AS STEP_COMMENT,
STEP.ST_STATUS AS STEP_STATUS,
STEP.ST_STEP_ORDER AS STEP_ORDER,
STEP.ST_USER_01 AS STEP_TYPE,
RUN.RN_RUN_ID AS RUN_ID From ((((((RELEASES JOIN RELEASE_CYCLES
ON RELEASES.REL_ID = RELEASE_CYCLES.RCYC_PARENT_ID
AND RELEASES.REL_NAME = 'XYZ') LEFT JOIN CYCLE
ON RELEASE_CYCLES.RCYC_ID = CYCLE.CY_ASSIGN_RCYC) LEFT JOIN TESTCYCL
ON CYCLE.CY_CYCLE_ID = TESTCYCL.TC_CYCLE_ID) LEFT JOIN RUN
ON TESTCYCL.TC_TESTCYCL_ID = RUN.RN_TESTCYCL_ID) LEFT JOIN TEST
ON TESTCYCL.TC_TEST_ID = TEST.TS_TEST_ID) LEFT JOIN STEP
ON RUN.RN_RUN_ID = STEP.ST_RUN_ID) WHERE (TEST.TS_TYPE = 'MANUAL' OR
TEST.TS_TYPE = 'QUICKTEST_TEST' OR TEST.TS_TYPE = 'LR-SCENARIO')
AND RUN.RN_RUN_ID in(Select max(RUN.RN_RUN_ID) From (((((((RELEASES JOIN RELEASE_CYCLES
ON RELEASES.REL_ID = RELEASE_CYCLES.RCYC_PARENT_ID AND RELEASES.REL_NAME = 'XYZ')
LEFT JOIN CYCLE ON RELEASE_CYCLES.RCYC_ID = CYCLE.CY_ASSIGN_RCYC)
LEFT JOIN TESTCYCL ON CYCLE.CY_CYCLE_ID = TESTCYCL.TC_CYCLE_ID)
LEFT JOIN RUN ON TESTCYCL.TC_TESTCYCL_ID = RUN.RN_TESTCYCL_ID)
LEFT JOIN TEST ON TESTCYCL.TC_TEST_ID = TEST.TS_TEST_ID)
LEFT JOIN STEP ON RUN.RN_RUN_ID = STEP.ST_RUN_ID)
LEFT JOIN LINK ON STEP.ST_ID = LINK.LN_ENTITY_ID AND LINK.LN_ENTITY_TYPE = 'STEP')
WHERE (TEST.TS_TYPE = 'MANUAL' OR TEST.TS_TYPE = 'QUICKTEST_TEST' OR
TEST.TS_TYPE = 'LR-SCENARIO')AND TEST.TS_TEST_ID =145965
ORDER BY TESTCYCL.TC_TESTCYCL_ID)
ORDER BY TESTCYCL.TC_TESTCYCL_ID,STEP.ST_STEP_ORDER
左括號太多! (((((((RELEASES' –
添加一個結尾括號 – SilverlightFox
我們不是人工編譯器,去掉你的查詢並遞增地返回 – OldProgrammer