Dan Olsson
Programmer
Hi, folks, hope you are having a good time in the holidays. I probably only have a brain freeze but I can't solve this just now .
I have a table where I need to sum some fields from our version of a SSN (Personal Identification Number).
Something like this (simplified):
Easy right? The problem is that the SSN can be in more than one row in the table and the result doesn't combine them to one row (and one sum). I'm sure I have done this before, but just now I can't for my life think of the right syntax. I'm sure though that you can
I have a table where I need to sum some fields from our version of a SSN (Personal Identification Number).
Something like this (simplified):
Code:
SELECT SSN, SUM(salary) FROM ALIAS() GROUP BY 1
Easy right? The problem is that the SSN can be in more than one row in the table and the result doesn't combine them to one row (and one sum). I'm sure I have done this before, but just now I can't for my life think of the right syntax. I'm sure though that you can