Getting non duplicate results from bridging table

43
January 12, 2019, at 02:30 AM

I have three tables, contact, contact_category and contact_categories.

contact
contact_id, contact_first_name,......
contact_category
contact_category_id, contact_category_name
contact_categories
contact_categories_id, fk_contact_id, fk_contact_category_id

I want to know the SQL that I need so I can get all contacts that have a distinct fk_contact_category_id

Hope this makes sense, cheers

READ ALSO
PHP While Statement Delete only one row from table Mysql PDO

PHP While Statement Delete only one row from table Mysql PDO

I have a while statement and a PDO statement to delete one row if someone clicks the delete button

23
How do I convert a number enum column to tinyint?

How do I convert a number enum column to tinyint?

Developing in Laravel 57, using a MySQL database

49
Ask for a quick update method for records that containing duplicate values

Ask for a quick update method for records that containing duplicate values

I have a table with millions of records, but each object could have multiple columns that share the same values while some other columns have different values

50