[ic] Need help with a perl query

Peter peter at pajamian.dhs.org
Tue May 26 23:15:58 UTC 2009

On 05/26/2009 11:04 AM, IC wrote:
> I am trying to create a picking list of items from orders where the status
> is processing, I could really do with picking up the item description as
> well as the sku which I presume would mean another query to the products
> table??

There is a description field in the orderline table that you can access
for this, if you want the comment (long description) then you will need
to do a join with the products table.

> Next I want to be able to list the total quantity required of single sku, ie
> if 10 orders each want 1 of sku os00001 then I want my list to tell me to
> pick 10 rather than just the list the sku 10 times...

Use the GROUP BY clause along with count(*) (see the documentation for
your db server).  Experiment with queries in the backend of your db
server (mysql or psql) to work out the exact query to give you the
output you want.


More information about the interchange-users mailing list