MySQL、Spark SQL 嵌套查询(二层、三层、多层)

MySQL、Spark SQL 嵌套查询(二层、三层、多层)

二层查询

select * from(select * from(select substring(``,1,3) from `big1`)t1 join
        (select substring(``,1,3) from `big2`)t2 on 1=1)tt 
        where tt.aa>3

三层查询

select * from(select * from(select substring(``,1,3) from `big1`)t1 join
        (select * from (select substring(``,1,3) from `big2`)t2 join 
        (select substring(``,1,3) from `big3`)t3 on 1=1
        )t4 on 1=1)tt 
        where tt.aa>3

Guess you like

Origin blog.csdn.net/white_mvlog/article/details/114738294