The title may not represent the issue well.
I have a table with information about cars (id (CP), name, model, among others) and another one with the "Extras" (id (CP), car_id (CS) p>
+---------------------+
| tbl_carros |
+---------------------+
| ID | Marca | Modelo |
+----+-------+--------+
| 22 | VW | Golf |
+----+-------+--------+
| 23 | Smart | ForTwo |
+----+-------+--------+
| 34 | BMW | 740d |
+----+-------+--------+
+------------------------------+
| tbl_extras |
+------------------------------+
| ID | id_car | Extra |
+----+--------+----------------+
| 1 | 22 | Airbag |
+----+--------+----------------+
| 2 | 22 | ABS |
+----+--------+----------------+
| 3 | 22 | Cruise Control |
+----+--------+----------------+
| 4 | 24 | ABS |
+----+--------+----------------+
| 5 | 24 | Airbag |
+----+--------+----------------+
Above are the two tables in question.
What I needed was a way to display the car data (Make, Models) ONLY if the extras I want are related to it, ie when I order all cars with ABS and Cruise Control, the only result in this case is VW Golf, in a single row. If there is more than one car with the same extras, it also needs to be presented.
I hope I made myself understood. I can always answer any questions you may have.
What I've tried
I've tried to make a query where one of the conditions was that the record was present in another table, but since the extras are separated by rows, I could not search for all the rows and at the same time only present a record.
In other words, the solutions I tried to exploit do not seem to me efficient or are too complicated and for simple lack of knowledge (experience), I'm not seeing how I can do this.