tags:

views:

198

answers:

1

Mysql question. I want to export one single row from one table with a catch: I want to pull together with it all the rows in all other tables referenced from the initial row by foreign keys - and referenced from the new rows too, recursively, until I get all rows that the initial one "needs to exist".

How can I do that?

+1  A: 

Add more inner joins until you make it through your data structure

Select * from table1 t1 
inner join table2 t2 on
t1.pk = t2.fk
inner join table3 t3 on
t2.pk = t3.fk
.......
where t1.pk = {pk id number} limit 0,1
andrewWinn