Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I'm new to SQL and have a problem/query.
I want to return data from 2 tables, tblPerson and tblPersonAddress. A person can have many addresses.
I want to return all the addresses for each person (with id per_id), but I only want the persons name to be returned once.
Currently with the query below I get all addresses, but the names are returned with each address. How do I filter this?
Here's my current query:
SELECT
p.per_id, p.per_last_name,p.per_first_name, pa.add_id, pa.add_text, pa.add_county, pa.add_country
FROM tblPerson p, tblPersonAddress pa
WHERE p.per_id = pa.per_id
GROUP BY p.per_last_name,p.per_first_name,pa.add_id, pa.add_text, pa.add_county, pa.add_country, p.per_id
TIA,
Luke