List:General Discussion« Previous MessageNext Message »
From:Randy Chrismon Date:December 5 2003 2:59am
Subject:Re: How to query
View as plain text  
  I'm stumped...

>Now, I need to generate reports for a specific client. In the end,
>a given month, I have to tell the client
>1. Which invoices were for the purchase of blue widgets, only.
>2. Which invoices were for the purchase of blue widgets and yellow
>widgets, together.
>3. Which invoices for the purchase of green doodads, only.
>4. Which for green doodads along with yellow widgets, together.
>Out of 1,000   product codes, I'm interested in 10 or so. It's easy
>enough to write any one of the queries but I can't figure out how to
>group/order in such a way as to do it all in one query and to order
>the 10 or so products I'm interested in. 
>MySQL is 4.0.12. 
I guess I should be a little more specific. This is actually invoicing 
for services rendered. There are 1000+ codes for the various services, 
plus one additional, PREM, for premium processing. What the client needs 
to know is how many L1 visas were filed, how many with premium 
processing, how many L1 extensions, how many with premium processing, etc.

The very nice and very smart lady who is running this report is using 
Crystal Reports and neither one of us knows what it's doing under the 
hood. But, in response to the trouble she is having, she wants to 
de-normalize the bejeebers out of MY tables by adding 10, or so, columns 
to the invoice table for each of the codes she's interested in. As you 
might guess, I'm dragging my heels, kicking and screaming, but that 
leaves it up to me to solve the problem.

Any help would be appreciated.


How to queryRandy Chrismon4 Dec
  • Re: How to queryRandy Chrismon5 Dec