标签:style blog io 使用 div sp on c log
使用SQL VIEW和CTE(common table expression)去把复杂查询简化,而不要使用JOIN,影响性能。
WITH step1 AS (SELECT 1,2 FROM orders o, src1 c WHERE c.key1 = o.key1 AND con1=1), step2 AS (SELECT 3,4 FROM step1, src2 s WHERE step1.key2 = s.key2 AND con2=‘2‘), step3 AS (SELECT 5,6 FROM step2, src3 WHERE x = y) SELECT * FROM step3
标签:style blog io 使用 div sp on c log
原文地址:http://www.cnblogs.com/pegasus923/p/3987234.html