Page 1 of 1

JOIN in DB

Posted: Mon Feb 02, 2004 11:48 am
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

Posted: Mon Feb 02, 2004 12:40 pm
by McGruff
That's not possible, afaik.

You can get them all with an INNER JOIN ... USING(id).

Posted: Mon Feb 02, 2004 12:44 pm
by vijayanand16
how?

Posted: Tue Feb 03, 2004 9:21 pm
by McGruff