--482, ORACLE / SQL SERVER --订购数量超过平均值的书籍 WITH Orders_Book AS ( SELECT Book_Name, SUM(Qty) Book_Qty FROM Orders GROUP BY Book_Name ) SELECT * FROM Orders_Book WHERE Book_Qty > ( SELECT AVG(Book_Qty) FROM Orders_Book ) --递归 产生连续数列1至10000 WITH Tally(N)…
这篇是7788凑的:":="是赋值语句 如: l_name :='sky';..."=" 是判断是否相等. 如: if 1=1 then...":" 是变量绑定 如: if :P_NAME ='sky' then... 变量绑定 是指在sql语句的条件中使用变量而不是常量.比如shared pool里有两条sql语句,select * from tab1 where col1=1;select * from tab1 where col1=2;对…