Re: Database efficiency question
A basic join (or left join depending on what you need) will do the trick. Example:
SELECT
t1.* # or list just the columns you want
, t2.* # or list just the columns you want
FROM
`table1_name` t1
JOIN
`table2_name` t2
USING
(id)
;
That's it really. Without a WHERE clause you'll get all rows back that the id matches in both tables.
If the column name is not the same in both tables then replace my USING (id) with this:
ON
(t1.column_name = t2.column_name)
hth.
Subject
Written By
Posted
Re: Database efficiency question
January 15, 2011 03:28AM
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.