I have a SELECT with a group by. I saw that I have to put each field in the select in the group by. But what if I need more field in my select that I don't want to group by them?
for example I have this code and I would like to add the field co_num in the select without to group by it.
SELECT co_ship.ship_date, coitem.item, accum = sum(coitem.qty_shipped)
FROM co_ship
INNER JOIN coitem
ON (coitem.co_num = co_ship.co_num and coitem.co_line = co_ship.co_line)
INNER JOIN item
ON (item.item = coitem.item)
where co_ship.ship_date = @shippingdate
AND item.uf_country_of_origin = @country
group by co_ship.ship_date, coitem.item
Thanks in advance
for example I have this code and I would like to add the field co_num in the select without to group by it.
SELECT co_ship.ship_date, coitem.item, accum = sum(coitem.qty_shipped)
FROM co_ship
INNER JOIN coitem
ON (coitem.co_num = co_ship.co_num and coitem.co_line = co_ship.co_line)
INNER JOIN item
ON (item.item = coitem.item)
where co_ship.ship_date = @shippingdate
AND item.uf_country_of_origin = @country
group by co_ship.ship_date, coitem.item
Thanks in advance