List:General Discussion« Previous MessageNext Message »
From:cool@hosting4days.com Date:August 25 2009 11:21pm
Subject:Basic SQL Query Help Needed
View as plain text  
I have a basic invoice table with related line items table

Goal :    I'd like to get ALL the related line items - for ALL the  
'open' invoices...

-- this should get a list of open (unpaid) invoices

$query_invoice = "SELECT DISTINCT ID from invoices where status =  
'open'"

-------------

-- then I'd like to get ALL the line items - in ALL these 'open'  
invoices - so how do I write the next SQL statement :

$query_items = ??? "SELECT ID, NAME from lineitems where --xx??? 
xx--" ???



Thanks,
cool@stripped





Thread
Basic SQL Query Help Neededcool@hosting4days.com26 Aug
  • RE: Basic SQL Query Help NeededMartin Gainty26 Aug