Query for 2 Databases?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
phppick
Forum Commoner
Posts: 57
Joined: Thu Aug 14, 2003 5:59 am

Query for 2 Databases?

Post by phppick »

Can anybody tell me how write a Query connecting 2 Database tables.
Suppose Database "A" Got table1 and Database "B" got table2. i wnat to get some data by joining these 2 tables.

A.table1 and B.table2
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

There's a nice tutorial about this here.
User avatar
nigma
DevNet Resident
Posts: 1094
Joined: Sat Jan 25, 2003 1:49 am

Post by nigma »

Thanks for the link patrik, I have wondered that myself but didn't know what it was called so searching didn't help me.
derek
Forum Newbie
Posts: 17
Joined: Sat Aug 16, 2003 11:31 am

Post by derek »

SELECT table1.name, table2.grade FROM table1,table2 WHERE table2.marks < 60 AND table1.age = 20 ORDER BY DESC LIMIT 0,1;
Post Reply