Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Select 0 if no value exists

506427Apr 14 2006 — edited Apr 17 2006
Hi! I`m a little stuck with a bit of SQL I need to write.
Hope someone can help!

I create an array in c++ and then run a select with IN in the where clause and the list of all elements of the array.
The problem is, that if I have missing information the selected recordset is not as dense as the original array and that makes my c++ code ever the more complicated.
I was wondering if there is a way (in simple SQL) to get 0 where no value exists.

Here is an example of my sql:
select score from scr1 where scrid = 1829 and usrid in (4227,3292,3391,1181,2909);
I want to get a 0 where a score for the specified user is not found.
Thanks in advance for any help you can supply.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 15 2006
Added on Apr 14 2006
10 comments
1,743 views