I have 2 tables. tblContacts and tblAddresses. There is a 1 to many relationship between tblContacts and tblAddresses = a contact can have more than 1 address, and an address can only belong to 1 contact.
Here is what I want to do in pseudo code.
select tblcontacts.lastname,all cities found in tbladdresses for the contact seperated by commas
from tblcontacts, tbladdresses
where tblcontacts.contactid = tbladdresses.addressid
ie:
Jackson New York,Chicago,LA
Smith Boston,London,Toronto,LA
I dont' want:
Jackson New York
Jackson Chicago
Jackson LA
Smith Boston
Smith London
Smith Toronto
Smith LA
Is it possible to do this in 1 query somehow? If so, how?
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Most Valuable Expert award recognizes technology experts who passionately share their knowledge with the community, demonstrate the core values of this platform, and go the extra mile in all aspects of their contributions. This award is based off of nominations by EE users and experts. Multiple MVEs may be awarded each year.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.