MySQL Forums
Forum List  »  Newbie

LEFTJOIN ???
Posted by: Tony Mole
Date: December 12, 2017 11:41AM

Hi all

Hopefully this is the right place to post this - if not apologies in advance.

I have two tables in a MySQL database one database holds stock info but lacks the stock qty. The second table contains the stock quantities. I have a 'merge' process working in Excel using VLOOKUP... but am migrating everything to MySQL and this is the final piece of the puzzle I cant get working.

Table 1 is called stock_price and hes the following fields;
Man_Pt_Nr
Sup_Pt_Nr
Manufacturer
Description
Qty - this field is populated with 0's as there is no data (yet!)
Cost
RRP
Weight
ETA
Disti
Condition

Table 2 is called stock_total and has the following fields;
Sup_Pt_Nr
Qty

I am convinced I need to use LEFTJOIN but every attempt causes my Ubuntu Webserver to hang and needs to be rebooted. The best I have come up with is this...

SELECT stock_price.Man_Pt_Nr, stock_price.Sup_Pt_Nr, stock_price.Manufacturer, stock_price.Description, stock_total.Qty, stock_price.Cost, stock_price.RRP, stock_price.Weight, stock_price.ETA, stock_price.Disti, stock_price.Condition
FROM stock_price
LEFT JOIN stock_total ON stock_price.Sup_Pt_Nr = stock_total.Sup_Pt_Nr

Can anyone offer any advice?

Options: ReplyQuote


Subject
Written By
Posted
LEFTJOIN ???
December 12, 2017 11:41AM
December 12, 2017 12:04PM
December 12, 2017 03:39PM
December 12, 2017 05:21PM
December 13, 2017 03:04AM
December 13, 2017 03:29AM
December 13, 2017 08:38AM
December 13, 2017 08:45AM
December 13, 2017 10:34AM
December 15, 2017 09:57AM
December 16, 2017 04:44AM
December 19, 2017 10:17AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.