我无法在下面的常见表表达式查询中找出问题。我收到错误消息
错误:42601:输入末尾的语法错误。
有人可以帮助我在查询中找到问题吗?
谢谢。
WITH rpt_1 AS
(SELECT count(*) as cnt, count(distinct memberid) as mem_cnt from table1),
rpt_2 AS
(SELECT count(*) as cnt, count(distinct memberid) as mem_cnt from table2);
答案 0 :(得分:0)
您没有使用通过WITH
关键字创建的临时表。语法如下:
with w1 as (select * from sales), w2 as (select * from supplies)
select * from w1; -- You are skipping this part, which is required