1
有一種方法可以在計算後創建一個別名?行的計算後創建一個別名?
在實踐中有寫這個更好的方法:
select
case when aaa ... then then else end AS ALIAS1,
case when bbb ... then then else end AS ALIAS2,
case when ccc ... then then else end AS ALIAS3,
/* the sum of previous aliases */
case when aaa ... then then else end +
case when bbb ... then then else end +
case when ccc ... then then else end AS ALIAS_SUM
預先感謝您
謝謝你現在...我在努力! – skyline26 2012-04-09 23:32:55
如果我在主SELECT中有一個連接,我必須在內部SELECT中執行它? – skyline26 2012-04-09 23:37:13
基本上,你可以在子查詢中做所有事情,然後只需在外部查詢中進行添加...因此,在外部聯接並不是真的需要在外部 – 2012-04-09 23:40:22