Re: Database efficiency question
Posted by: SEO Innoexcel
Date: January 15, 2011 03:28AM

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.

Options: ReplyQuote


Subject
Written By
Posted
January 04, 2011 10:46PM
January 06, 2011 09:11PM
January 07, 2011 11:18PM
January 08, 2011 12:59AM
January 08, 2011 10:02AM
January 08, 2011 10:38AM
January 08, 2011 11:02AM
January 16, 2011 03:30PM
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.