I have four tables that I want to join and display the output all together. I'm not sure how the syntax works for Oracle SQL Developer. I know this is an easy question for a programmer and I was hoping someone can make a suggestion on how the code might look like.
The tables are:
JNL1
JNL2
JNL3
JNL4
The key that is common between all four of these tables is ItemID.
How would the query look like? Thanks
It really depends on what kind of join you want (outer or not) but you can use default SQL syntax.
For example, joining without the JOIN keyword:
select * from JNL1, JNL2, JNL3, JNL4,
where
JNL1.ItemID = JNL2.ItemID AND
JNL2.ItemID = JNL3.ItemID AND
JNL3.ItemID = JNL4.ItemID;
Additionally you can make use of multiple INNER JOINS e.g.
SELECT whatever
FROM JNL1 AS a
INNER
JOIN JNL2 AS b
ON b.ItemID = a.ItemID
INNER
JOIN JNL2 AS c
ON c.ItemID = b.ItemID
INNER
JOIN JNL2 AS d
ON d.ItemID = c.ItemID
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With