A
Andreas
Hi all,
I want to create the following query which calculates sums with NULL
values and COUNT the occurance of certain values:
1 | 2 | SumOf1_2
-----------------------------
2 3 5
1
5 0 5
3
I tried this:
SELECT isnull([1],0) + isnull([2],0) AS SumOf1_2
FROM tab_Cards_2008;
Unfortunately it doesnt work. Any ideas what my mistake is?
In a next step (or the same) I would like to COUNT eg. all the Sums of
5 (in this case 2 times) how is the best way to do that?
Maybe that:
SELECT COUNT (isnull([1],0) + isnull([2],0)) WHERE (isnull([1],0) +
isnull([2],0))=5 AS CountOf1_2
FROM tab_Cards_2008;
Sorry if this has a very easy answer, but I am new in SQL and have
tried several things to solve this.
Thanks for your help,
Andreas
I want to create the following query which calculates sums with NULL
values and COUNT the occurance of certain values:
1 | 2 | SumOf1_2
-----------------------------
2 3 5
1
5 0 5
3
I tried this:
SELECT isnull([1],0) + isnull([2],0) AS SumOf1_2
FROM tab_Cards_2008;
Unfortunately it doesnt work. Any ideas what my mistake is?
In a next step (or the same) I would like to COUNT eg. all the Sums of
5 (in this case 2 times) how is the best way to do that?
Maybe that:
SELECT COUNT (isnull([1],0) + isnull([2],0)) WHERE (isnull([1],0) +
isnull([2],0))=5 AS CountOf1_2
FROM tab_Cards_2008;
Sorry if this has a very easy answer, but I am new in SQL and have
tried several things to solve this.
Thanks for your help,
Andreas