动态参数查询
oracle 查询中,&为输入参数
执行时,自动弹出参数,让你输入,输入完自动查询:
SELECT * FROM (
SELECT p.id,p.picture,p.NAME,am.ACTIVITYRULE3,am.bid,am.strvalue as nowPrice,
ap.GIFTSTAGE FROM T_ACTIVITY_PRO ap
JOIN T_PRODUCT p oN p.ID = ap.PRODUCTID
LEFT JOIN
(
SELECT a.*,b.id AS bid,b.strvalue
FROM T_ACTIVITY_MORE a ,
table(fn_split(a.ACTIVITYRULE3,',')) b
) am ON am.ID=ap.PROMOTIONID
WHERE 1=1 AND ap.GIFTSTAGE < 0
ORDER BY ap.GIFTSTAGE,am.bid
) c WHERE (c.GIFTSTAGE =1 AND c.bid = 2) OR (c.GIFTSTAGE =2 AND c.bid = 4) OR (c.GIFTSTAGE =3 AND c.bid = 6)
文章来源: blog.csdn.net,作者:网奇,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/jacke121/article/details/54429533
- 点赞
- 收藏
- 关注作者
评论(0)