CREATE VIEW ITCC.release_testcase_count
AS
(
SELECT CONCAT(rtm.requirement_id,'-',tct.release_id) AS id,
rtm.requirement_id AS requirement_id,
tct.release_id AS release_id,
COUNT(tct.release_id) AS testcase_count
from testcase_version tcv
INNER JOIN tcr_catalog_tree_testcase tct ON tcv.id = tct.testcase_version_id
LEFT JOIN requirement_testcase_mapping rtm ON rtm.testcase_id=tcv.testcase_id
GROUP BY tct.release_id , rtm.requirement_id
);
相同的查询适用于ms sql和我的sql,没有任何语法错误。我也想在oracle中执行它,但是我却因为相同而报错
答案 0 :(得分:3)
Oracle CONCAT
函数仅需要两个参数,而不是三个或三个以上参数。代替使用CONCAT
,只需使用串联运算符:
CREATE VIEW ITCC.release_testcase_count AS (
SELECT rtm.requirement_id || '-' || tct.release_id AS id,
...
)
或者,如果您真的想在此处使用CONCAT
,则可以将它们链接在一起:
CREATE VIEW ITCC.release_testcase_count AS (
SELECT CONCAT(rtm.requirement_id, CONCAT('-', tct.release_id)) AS id,
...
)