MySQL Forums
Forum List  »  General

Re: Join and Not Equal to results
Posted by: Brian LaMaster
Date: February 08, 2017 02:33PM

So I got this to work...

SELECT Orders01.name, 'Lineitem quantity'
FROM Orders01
INNER JOIN Orders02
ON Orders01.name = Orders02.name
and Orders01.`Lineitem name` = Orders02.`Lineitem name`
and Orders01.`Lineitem quantity` <> Orders02.`Lineitem quantity`

but... the actual quantities are not showing. Also, when I added LineItem SKU so that I could see the sku number, it gives me this error.
"#1052 - Column 'Lineitem name' in field list is ambiguous"

SELECT Orders01.Name, 'Lineitem sku', `Lineitem name`
FROM Orders01
INNER JOIN Orders02
ON Orders01.name = Orders02.name
and Orders02.`Lineitem sku` = Orders01.`Lineitem sku`
and Orders02.`Lineitem name` = Orders01.`Lineitem name`
and Orders02.`Lineitem quantity` <> Orders01.`Lineitem quantity`

Options: ReplyQuote


Subject
Written By
Posted
February 03, 2017 08:06AM
Re: Join and Not Equal to results
February 08, 2017 02:33PM


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.