1. 判断是否为数字:translate(@field ,'-0123456789','0') is null,另外可用@field<':'效率高。
2. 动态SQL调用参数:select * from tb where f=: v (不是@v )。
3. 缓存子查询结果:with t as(select * from tb) 。
4.使用with效率比临时表高,如果重复使用with两次或以上时在数据量小(10000条)时临时表要快。
1. 判断是否为数字:translate(@field ,'-0123456789','0') is null,另外可用@field<':'效率高。
2. 动态SQL调用参数:select * from tb where f=: v (不是@v )。
3. 缓存子查询结果:with t as(select * from tb) 。
4.使用with效率比临时表高,如果重复使用with两次或以上时在数据量小(10000条)时临时表要快。