Select 0 if no value exists
506427Apr 14 2006 — edited Apr 17 2006Hi! 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.