I'm trying to translate the below sql statement into web2py but I'm not
sure how to handle the union. Maybe I'm just not seeing the web2py union
command that would make translating this simple.

Anyone have any suggestions?

select * from drink where drink.drink_key not in (select drink_key from
ingredients_alcohol where alcohol_key not in (select alcohol_key from
alcohol where alcohol_type_key in (select alcohol_type_key from alcohol
where alcohol_key in (3, 2, 5))) union select drink_key from
ingredients_mixer where mixer_key not in (select mixer_key from mixer where
mixer_type_key in (select mixer_type_key from mixer where mixer_key in (2,
4, 6))) union select drink_key from ingredients_garnish where garnish_key
not in (1, 2, 5))


Thanks,
Amber

Reply via email to