我还添加了另一个TMP2并且无法运行查询...你能帮我解决这个问题吗?我正在使用Oracle 11g。
WITH TMP1(REQUEST_NO) AS (SELECT REQUEST_NO FROM QUOTE)
SELECT TMP1.REQUEST_NO FROM TMP1;
WITH TMP1(REQUEST_NO) AS
(SELECT REQUEST_NO FROM QUOTE),
TMP2(AGENT) AS (SELECT AGENT FROM AGENT_TAB)
SELECT TMP2.AGENT FROM TMP2;
我得到的例外是:
org.h2.jdbc.JdbcSQLException:
Syntax error in SQL statement "WITH TMP1(REQUEST_NO) AS (SELECT REQUEST_NO FROM QUOTE),
[*]TMP2(AGENT) AS (SELECT AGENT FROM AGENT_TAB) SELECT TMP2.AGENT FROM TMP2 "; expected "(,
SELECT, FROM"; SQL statement:
查询在sql开发人员中很好,但在Junit测试中没有工作。 JDBC:H2:MEM:request_no; MODE =甲骨文 我们正在使用h2版本1.3.171与Windows 7(64位)和jdk 1.7.0_25。