I'm currently running the following query:
SELECT * from people WHERE id = 4;
on the following table:
id name state age
-----------------------------------
1 tony jones CA 22
2 Sue Smith FL 50
3 Alex Guam AL 44
4 tony jones SC 32
5 tony jones OH 12
6 alex guam RI 33
7 tony Jones CO 17
I'd like to also return a list of other states that a person by that name lives in.
So in my query example I have id 4 for "tony jones" - I should also receive an "other_states" list of CA,OH,CO.
Is it possible in the one query or do I need to do a separate select after the fact based on 'name' ?