mysql - SQL - Select distinct rows and join them with another table to get data -



mysql - SQL - Select distinct rows and join them with another table to get data -

i have 2 tables:

1) person (person_id, person_name)

2) cars (car_id, person_id)

i want people's names have cars no duplicates.

this have come with:

select person.person_name, cars.person_id cars inner bring together person on person.person_id=cars.person_id

but don't want duplicates, need incorporate using this:

select distinct person_id cars

select person_name person person_id in ( select person_id cars )

mysql sql

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -