mysql实现with as的方法:
使用“with cr as(子查询)主查询”语句就可以查询sql片段了
示例如下:
with cr as ( select CountryRegionCode from person.CountryRegion where Name like 'C%' ) select * from person.StateProvince where CountryRegionCode in (select * from cr)
www#gaodaima.com来源gao@!dai!ma.com搞$$代^@码!网搞代码
其中cr是一个公用表表达式,该表达式在使用上与表变量类似,只是SQL Server 2005在处理公用表表达式的方式上有所不同。
更多Python知识,请关注:搞代码网!!
来源:搞代码网:原文地址:https://www.gaodaima.com