If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Joining two INSERT queries

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-23-04, 08:12
Jen76 Jen76 is offline
Registered User
 
Join Date: Jan 2004
Location: California
Posts: 10
Joining two INSERT queries

Need help with joining these two queries....the newly created Item_Billing_Link record needs two items inserted Product_ID, and Bill_ID...here are the two queries to get these ID's that need to be inserted...



INSERT INTO Item_Billing_Link (Product_ID) SELECT Products.Product_ID FROM Customers INNER JOIN Products on Customers.Cust_ID = Products.Cust_ID WHERE Customers.Bill_Cycle_ID = '1' AND Products.Recurring = 'yes'

INSERT INTO Item_Billing_Link (Bill_ID) SELECT Bill_ID FROM Bills WHERE Bills.Bill_ID >= LAST_INSERT_ID ()

Thanks
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On