例如有个苹果表apple:id,SecondspaceId(二级产地id或者说子产地id),appname;
产地标place:id,name,fid;
列出所有苹果的信息,包括一级产地和二级产地。
sql应该这样写:
select apla.*,place.name as fname from
(select apple.*,place.name,place.fid as sName from apple INNER JOIN place on apple.SecondspaceId=place.id) apla
INNER JOIN place on apla.fid=place.id