主要看多个with的格式
- WITH
- T3 AS
- (
- SELECT T1.ID, T1.CODE1, T2.DESCRIPTION
- FROM TB_DATA T1, TB_CODE T2
- WHERE T1.CODE1 = T2.CODE
- ),
- T4 AS
- (
- SELECT T1.ID, T1.CODE2, T2.DESCRIPTION
- FROM TB_DATA T1, TB_CODE T2
- WHERE T1.CODE2 = T2.CODE
- )
- SELECT T3.ID, T3.DESCRIPTION, T4.DESCRIPTION
- FROM T3, T4
- WHERE T3.ID = T4.ID
- ORDER BY ID;