2 messages in com.mysql.lists.mysqlQuery Question
FromSent OnAttachments
Wild Apache Support10 Jan 2001 11:31 
Johnson, Gregert10 Jan 2001 11:45 
Subject:Query Question
From:Wild Apache Support (supp@wildapache.net)
Date:01/10/2001 11:31:19 AM
List:com.mysql.lists.mysql

Hello,

I have a database with a two tables named invoices and line_items.

The line_item table contains information about each line_item from an invoice.

TABLE invoices ( invoice_number text, date date, due_date date, status varchar(20), num_of_line_items int(11), customer_po_number varchar(20), ship_via varchar(20), ship_date date, terms varchar(20), sales_rep varchar(20), customer_id int(11), invoice_total text, modified_date date );

-- TABLE line_items ( line_item_id int(11), invoice_number text, item_number text, number_of_items varchar(10), discount varchar(10), sell_price text );

Now I can have multiple linr_items per invoice.

How can I query my database to select the invoice_number for multiple line items?

That is, how can I retrieve the invoice_number for the invoice(s) that have both item_numbers '54321' and '56789'?

Thanks, Murrah Boswell