Re: MySQL Join 4 Tables
[Still not what I asked for (create table, insert), but ...]
Something like
this should get you close to what you want:
select
A.ID
, A.Des
, C.P_DATE
, C.ITEM_NO --- table c has no column called ITEM_NO !!
, D.REF_NO
, D.D_DATE
from table_a A
left join table_b B
on A.ID = B.ID
left join table_c C
on B.P_ID = C.P_ID
left join table_d D
on A.ID = D.ID
+----+-----+------------++--------+------------+
| ID | Des | P_DATE || REF_NO | D_DATE |
+----+-----+------------++--------+------------+
| 1 | xxx | 2022/10/12 || | |
| 2 | yyy | || B13 | 2022/09/30 |
| 3 | zzz | 2022/10/19 || | |
| 4 | aaa | || L84 | 2022/09/22 |
+----+-----+------------++--------+------------+
Regards, Phill W.
Subject
Written By
Posted
Re: MySQL Join 4 Tables
February 01, 2023 07:23AM
February 02, 2023 12:17AM
February 06, 2023 08:16AM
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.