faqts : Computers : Databases : MySQL : Language and Syntax

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

2 of 6 people (33%) answered Yes
Recently 2 of 6 people (33%) answered Yes

Entry

Selecting data from 2 tables (I'm a newbie)

Mar 15th, 2004 10:25
Matt Chatterley, Tray Murphy,


While this depends somewhat on precisely what you want to do, the
solution may well be to join the two tables together. E.g:
SELECT * FROM Table1 T1
INNER JOIN Table2 T2 ON T2.ID = T1.ID;
A 'Google' for keywords such as 'SQL JOIN' or 'MySQL JOIN SYNTAX' (or
perhaps the MySQL manual at www.mysql.com) will yield more detailed
information on the syntax, and types of join available.