All pastes #920631 Raw Edit

Someone

public text v1 · immutable
#920631 ·published 2008-02-27 15:07 UTC
rendered paste body
SELECT
s.zonename as zona,
count(l.late) as numero
FROM f_late l
inner join d_biosuppliers s on (s.d_biosuppliers_tk = l.d_biosuppliers_tk)
inner join d_biogroups g on (g.d_biogroups_tk = l.d_biogroups_tk)
where l.late >= {latethreshold}
and case when {PREPARE::groupname} <>'' then g.groupname IN ({PREPARE::groupname}) else true END 
group by s.zonename
order by numero