> select order_id from
> (select o.order_id from orders o join order_lines ol using (order_id)
> where o.time > '2006-01-01T00:00' and o.time < '2007-01-01T00:00'
> and (ol.item_id = 10 or ol.item_id = 11 or ol.item_id = 12) group by
> o.order_id) as prints
> inner join
> (select ho.order_
"Claus Guttesen" <[EMAIL PROTECTED]> writes:
> select order_id from
> (select o.order_id from orders o join order_lines ol using (order_id)
> where o.time > '2006-01-01T00:00' and o.time < '2007-01-01T00:00'
> and (ol.item_id = 10 or ol.item_id = 11 or ol.item_id = 12) group by
> o.order_id) a
Claus Guttesen wrote:
> Why does select and select(count) produce two different results?
count(expression) only counts nonnull values.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
---(end of broadcast)---
TIP 2: Don't 'kill -9' the
Forgot to mention that this is on postgresql 7.4.14 and FreeBSD 6.2.
regards
Claus
Hi.
I'm performing the following query to get all items sold in 2006 which
are in category prints or gifts, but not in extra:
select order_id from
(select o.order_id from orders o join order_lines ol using (or
Hi.
I'm performing the following query to get all items sold in 2006 which
are in category prints or gifts, but not in extra:
select order_id from
(select o.order_id from orders o join order_lines ol using (order_id)
where o.time > '2006-01-01T00:00' and o.time < '2007-01-01T00:00'
and (ol.ite