注:在之前工作的时候,数据需要根据时间查询出当月值和上月的值. 语法: WITH A AS( SELECT * FROM TABLE ), B AS (SELECT * FROM TABLE)SELECT * FROM A,B 注:个人理解为with后面跟着几张临时表,然后a为临时表名,可以有多张临时表,然后最后一个查询的表可以用临时表 例: WITH A AS( SELECT ID,TIME,SUM FROM TABLE ), B AS ( SELECT ID,TIME,SUM FROM TA