-1

i m going to prepare a report from three tables in php . the tables related to one another as Table A's primary key is a foreign key in Table B AND Table B's Primary Key is a foreign key in Table C .now i m going to select Data from table C and also from Table A. Table A And Table C are not directly Related to one another

Safdar Pathan
  • 11
  • 1
  • 7
  • Sougata exactly i m looking for JOINs – Safdar Pathan Mar 01 '16 at 06:39
  • Hi, u should explain your conditions in a easy way (maybe with pictures and codes) so that others can come easily to help u. AN example question- http://stackoverflow.com/questions/32263145/sweep-line-algorithm-implementation-for-1d-plane/32263146#32263146 – Abrar Jahin Mar 01 '16 at 07:00

1 Answers1

0

Try the following query:

select * from A
inner join B on A.primary_key = B.Foreign_key
inner join C on B.primary_key = C.foreign_key

Here A.primary_key  = A's primary key
Here B.Foreign_key  = A's primary key in B's table
B.primary_key = B's primary key
C.foreign_key = B's primary key in C's table
D.k
  • 442
  • 4
  • 13