Summary Report With Details - Newbie Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Folks,

I would like to make a summary report with details for a products inventory
list - so it could list:

A - the product & a few summaries like total count on 1 line
B - ------- below that: the details of a multi line sub list with inventory
data like:

A - PRODUCT #1 - count = 25
B ---------- id 56 - condition = good
------------ id 98 - condition = new
A - PRODUCT #2 - count = 18
B ---------- id 205 - condition = new
------------ id 381 - condition = poor

and repeat for all inventory products....

-----

The way I'm doing it now is :

main query #1

SELECT name,model, count(prid) as thecount FROM inventory group by model

then do a repeat region table to display 1 of each

- then - on each row - do sub query#2 :

SELECT name,model, condition (etc....) FROM inventory where model =
quety#1.model....

- then display these details in a sub table....


Q: This seems to work fine. I was just wondering if there is a better way to
construct queries to get the same result?


Thanks in advance for your help...

--
Thanks - RevDave
Cool @ hosting4days . com
[db-lists 09]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux