0
select T.n_acid,T.marca
from (select n_acid, veic_seguro, marca
from marca_acid as ma, veiculo as v
where ma.veic_seguro = v.n_veic) as T
group by T.n_acid, T.marca;
This query returns the table that appears in the photo. I need the query to return the brand of car that appears in all 8 n_acid that exist , IE, I need to return "Mercedes-Benz"
Any idea?
use the filter "like"
– Murilo Melo
But I don’t want the query to have "Mercedes," I want it to get there and return it
– Filipaaaaa
with like, you can make a dynamic change in the query using php for example, there is no way you can return something specific without giving a filter for it
– Murilo Melo
from the above query, I need to count how many times each car brand appears and see if this is equal to the count of rows from the accident table ( the accident table has a column n_acid)
– Filipaaaaa
Clarify there for us. In this case we showed you to us you need to return "Mercedes-Benz", OK. But which criterion ? You quoted the following I need the query to return the brand of car that appears in all 8 n_acid that exist What did you try to say by that ? Because the Audi also has a
n_acid
8. In short, explain better why your return should be this.– 8biT