JOIN in DB

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
vijayanand16
Forum Newbie
Posts: 12
Joined: Fri Jan 30, 2004 4:57 pm

JOIN in DB

Post by vijayanand16 »

Customer
id name pay
1 ashok 2000
2 kumar 1000
3 vijay 3000
4 anand 2000
5 ragu 1000
6 ganesh 6000
7 senthil 3000
8 Henry 9000
9 Reynold's 9000

Address

id address
1 a1
1 b1
1 b3
2 a2

i want to select maximum of 2 address for each of the customer from the 2 tables
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

That's not possible, afaik.

You can get them all with an INNER JOIN ... USING(id).
vijayanand16
Forum Newbie
Posts: 12
Joined: Fri Jan 30, 2004 4:57 pm

Post by vijayanand16 »

how?
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

Post Reply