日期:2014-05-17 浏览次数:20805 次
select 促销规则号,replace(wm_Concat(满足条件),',','/'),replace(wm_Concat(减现),',','/'), from table_name group by 促销规则号
------解决方案--------------------
10g以上试试如下:
select 促销规则 ,listagg(满足条件,'/') within group (order by 行号) 满足条件 ,listagg(减现,'/') within group (order by 行号) 减现 from ...
------解决方案--------------------
不同版本,参考这里
------解决方案--------------------
create or replace procedure a(a in varchar2,b out number)
as
c number;
d number;
e number;
begin
select 商品总价 into c from 商品表;
select 行号,减现 into d,e from 手绘表 where 满足条件>c;
b:=c-e;
end;
------解决方案--------------------
設置此表名為tSale
促銷規則:saleRuleNo
滿足條件:LevelMoney
減去額度:minusMoney
假如說該客戶的買的物品的價格是P,促銷序列號為N,則SQL語句如下:
select A.* from (select rownum rn,p-minusMoney from tSale where LevelMoney<P and saleRuleNo=N order by LevelMoney desc) A
where A.rn=1