Hey everyone. I need to join two tables according to those parameters:
1) I need only data that are both in the first and in the second table
2) Data in the second table can have more rows attached to one row of the first table, but I need those rows displayed only once.
I tried this
SELECT * FROM table AS p
JOIN `table2` AS ps ON (p.id = ps.`id_table2`)
ORDER BY p.id
but I am getting duplicates, as mentioned.
Thanks
Assuming you only care about the final output, use distinct: