sql query - how to count values in a row separately?

Posted by n00b0101 on Stack Overflow See other posts from Stack Overflow or by n00b0101
Published on 2010-03-29T00:31:43Z Indexed on 2010/03/29 0:33 UTC
Read the original article Hit count: 379

Filed under:
|
|
|

I have a table that looks something like this:

id | firstperson | secondperson
1 | jane doe |
2 | bob smith | margie smith
3 | master shifu | madame shifu
4 | max maxwell | 

I'm trying to count all of the firstpersons + all of the secondpersons, if the secondpersons field isn't blank... Is there a way to do that?

© Stack Overflow or respective owner

Related posts about postgresql

Related posts about sql