Hi, my question is near a parent-child problem, and may need some recursive query, but i didn't find any answers by browsing forums. here is my problem: I've got 3 tables:
T1 (people) T2 (places) T3 (relationship betwenn A and B) ------- ------ -------- id1 (pk) id2 (pk) id3 (pk) name city id_A id_B
I would like to identify groups of places and people that are related.
For example, if
John visits London and Paris,
Mary visits Paris and New York,
Peter visits Bangalore and Tokyo,
I would like to affect the same group code to Mary, John, Paris, London and New York, and another group code to Peter, Tokyo and Bangalore.
I really don't know how to do this with sql. Any Idea?
Thanks