在oracle中的select查询中定义多个变量

时间:2017-11-10 22:58:04

标签: oracle variables dynamic

获取错误..无法在一个查询中定义2个参数

  define price = 99.969000
  define isin = '9128283C2';
    WITH A AS
      (select BUY_SELL,CASE WHEN BUY_SELL = 0 THEN (&price - 0.0025)  ELSE (&price + 0.0025) END BS,PRODUCT_ISIN,QUANTITY
   from table1 t where t.t_dt = '01-nov-17'
 AND BUY_SELL = 0
AND quantity = 25 and product_isin = &isin)
SELECT * FROM A where row_num = 1; 

0 个答案:

没有答案