SQL> create table T_BUSINESS_DATA(user_id number(16),status varchar2(2),oper_date date);
select * from T_BUSINESS_DATA t where 1=1 and t.APP_USER_ID=:userId and t.STATUS <> 1 order by t.operDate desc
SQL> variable userId number;
SQL> exec :userId := 1;
PL/SQL procedure successfully completed.
select *
from T_BUSINESS_DATA t
where 1 = 1
and t.user_id = :userId
and t.STATUS <> 1
order by t.oper_date desc
SQL> select distinct user_id from T_BUSINESS_DATA;
USER_ID
----------
1
2222
999
3
10
select *
from T_BUSINESS_DATA t
where 1 = 1
and t.user_id = :userId
and t.STATUS <> 2
order by t.oper_date desc;
select *
from T_BUSINESS_DATA t
where 1 = 1
and t.user_id = :userId
and t.STATUS <> 3
order by t.oper_date desc;
select *
from T_BUSINESS_DATA t
where 1 = 1
and t.user_id = :userId
and t.ST
sql 绑定变量问题
最新推荐文章于 2023-03-02 16:38:26 发布