Here is my table schema.

Thanks for your help.

David


ORDERS

+--------------+---------------------------
| Field        | Type                      
+--------------+---------------------------
| id           | int(10) unsigned zerofill 
| clientid     | int(11)                   
| refid        | int(11)                   
| sessionid    | varchar(40)               
| staffid      | int(11)                   
| staffcomp    | date                      
| auth_code    | varchar(6)                
| trans_id     | varchar(30)               
| dt_trans     | datetime                  
| job_target   | smallint(6)              
| exp_level    | smallint(6)              
| careerchg    | char(1)                  
| subtotal     | float(10,2)              
| tax          | float(10,2)              
| rushfee      | float(10,2)              
| total        | float(10,2)              
| dt_create    | datetime                 
| dt_timestamp | datetime                 
| dt_update    | date                     
+--------------+--------------------------

ORDERDETAIL

+----------------+---------------------------
| Field          | Type                      
+----------------+---------------------------
| id             | int(10) unsigned zerofill 
| orderid        | int(11)                   
| itemid         | varchar(10)               
| qty            | int(11)                   
| unitcost       | float(10,2)               
| extended       | float(10,2)               
| grp_id         | varchar(10)               
| grp_pwd        | varchar(10)               
+----------------+---------------------------



-----Original Message-----
From: Michael T. Babcock [mailto:[EMAIL PROTECTED]] 
Sent: Friday, October 04, 2002 1:00 PM
To: '[EMAIL PROTECTED]'
Subject: Re: Query help

David McInnis wrote:


>>select tax from orders, orderdetail where orders.id =
>>orderdetail.orderid and (productid = 1 or productid = 2 or productid =
>>3) 
>>
>>I can get multiple tax amounts where an order has multiple matching
>>records in orderdetail.  I know that I can group by order.id, but what
I
>>eventually need to do is pull sum(tax) and not just tax.
>>  
>>
>  
>
Post the basic schema for the database tables in question and it would 
help.  It doesn't sound like you need a subselect, but that may just be 
a misinterpretation.

PS, I'd like some stats from the mysql list admins as to how many
messages a day are blocked because of the requirement to include SQL or
QUERY in the message and how many of those are _actually_ spam ... just
watch for one day ...

-- 
Michael T. Babcock
C.T.O., FibreSpeed Ltd.
http://www.fibrespeed.net/~mbabcock



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to