I was playing a bit with sqlite and encountered the following problem: it looks like it is not possible to nest a subquery in a having clause
When I try to call a query with:
... having count(select * from produkt) > 1
I get the error:
OperationalError: near "select": syntax error
While executing
... having count(1) > 1
everything is fine
Would you have any workarounds for that?
edit2:
I want to write this:
select distinct standort.name, standort.ort
from produktion
join standort on id_standort = standort.id
join produkt on id_produkt = produkt.id
where produkt.gewicht < 1
EXCEPT
select distinct standort.name, standort.ort
from produktion
join standort on id_standort = standort.id
join produkt on id_produkt = produkt.id
where produkt.kategorie = "Spiel"
In a more elegant way, using "having"
Cheers and thanks a lot!
Wojtek