MYSQL left joins
Hi, Ive looked at various tutorials for MYSQL left-joins using the same table. However I'm getting no results (or incorrect MYSQL errors).
This code below i found on a website/forum reply, But backed out of it & lost the URL
CODE:
SELECT
ca.*
FROM
categories ca
LEFT JOIN categories catwo
USING Reference
WHERE
ca.CATEGORY eq 'ACCOUNT'
1) "ACCOUNT" is a word/category i want to find in the CATEGORY field of the table
2) This will bring up a record with CATEGORY as a match & give me all fields.
3) using the matching 'Reference' - I'm wanting it to bring up all the other records that match the 'Reference'.
Currently i have only 3 records - one referece, but having 3 different categories.
(so far my PHP script is resulting in blank/no results. But the MYSQL conso;e says ive got an error in my SQL.)
Any advice welcome please.
Subject
Written By
Posted
MYSQL left joins
May 16, 2020 03:18AM
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.