|
-
user_id like decode(@user_id,null,'%',@user_id);
Here's the test case:
create table test_user (user_id number);
desc test_user;
--Name Null? Type
--USER_ID NUMBER
insert into test_user values (1);
insert into test_user values (2);
select * from test_user where user_id like decode(null,null,'%',null);
--returns all records because @user_id is null
select * from test_user where user_id like decode(1,null,'%',1);
--returns only user_id 1
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|