Hello;
I have a table:
I need to create an ouput like this:Code:ID Cat1 Cat2 Cat3
1 4 2
2 3 1
3 7 3 2
4 5
Any suggestions?Code:ID Cat1 Cat2 Cat3 MaxValue Sum
1 4 2 4 6
2 3 1 3 4
3 7 3 2 7 12
4 5 5 5
Thanks!
Printable View
Hello;
I have a table:
I need to create an ouput like this:Code:ID Cat1 Cat2 Cat3
1 4 2
2 3 1
3 7 3 2
4 5
Any suggestions?Code:ID Cat1 Cat2 Cat3 MaxValue Sum
1 4 2 4 6
2 3 1 3 4
3 7 3 2 7 12
4 5 5 5
Thanks!
yesmein, Try something like:
Code:SELECT ID, Cat1, Cat2, Cat3
, MAX(Cat1, Cat2, Cat3) AS MAXVALUE
, (Cat1 + Cat2 + Cat3) AS SUMVALUE