例子:
select
SUM(case when is_deleted='Y' then price else 0 end) as total_of_deleted_item_price,
SUM(case when is_deleted='N' then price else 0 end) as total_of_item_price,
cust_id
from order group by cust_id
*Nickname: | |
E-mail: | |
Blog URL: | |
#Nickname#
2014/9/3 下午 12:43:31
#CommentContent#
|
|
*請輸入驗證碼: | 看不懂,換張圖 |