If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
(1) I'm assuming that the "1e2" part of Pat's solution is the same as "1 ELSE 2".
(2) when there are no rows with the matching column, I'm getting a result of "1" instead of the desired "0". Maybe I'm doing something wrong?
(3) So, I don't think r937's "your solution is the same as pat's" comment is correct.
1. no it isn't -- perhaps you should try it and see what 1e2 actually is
2. when there are no rows, you are getting what? with whose query?
3. well yours and pat's are sort of the same in that you aren't counting nulls and he's not summing them!!!!