Skip to content

SQL subquery for function count

The first column is the name of the locality,the second column is the number of voters in every locality.. my problem is on the third column because im trying to count voters that are unemployment but …

SQL WHERE look for 2 data in one column

I got 2 tables item: name id other part: name_part id other I wish to make a query to find what item is linked with name_part = ‘a’ AND name_part = ‘b’ 2 different parts in a same item Query: …

SQL Group By, case when on aggregated

Can’t wrap my mind around the next task: I have a table, with some key, which represents some kind of group id. I would like to GROUP BY by this key and in resulted table show some columns from this …

Find all recipes with just vegan products

I have been trying to find all recipes with just vegan products but so far I just have this: SELECT DISTINCT r.* FROM recipes r INNER JOIN recipe_product rp ON r.id = rp.recipe_id INNER JOIN products …