------解决方案--------------------
select * from 主表 a inner join 性别代码表 b on a.xbID=b.id inner join 专业代码表 c on a.zyID=c.id inner join 政治面貌代码表 d on a.zzmmID=d.id
------解决方案--------------------
------解决方案--------------------
SQL code
SELECT M.ID,name,A.value,B.value,C.value
FROM 主表 AS M INNER JOIN 政治 AS A ON M.zzmmID = A.id
INNER JOIN 性别 AS B ON M.xbid = B.id
INNER JOIN 专业 AS C ON M.zyID = C.id
------解决方案--------------------
SQL code
select a.id,a.name,d.value as 政治面貌的值,b.value as 性别的值,c.value as 专业的值
from 主表 a
left join 性别代码表 b on a.xbID=b.id
left join 专业代码表 c on a.zyID=c.id
left join 政治面貌代码表 d on a.zzmmID=d.id
------解决方案--------------------
SQL code
select id, name, b.value,c.value,d.value from 主表
left join 性别代码表 b on a.xbID =b.id
left join 政治面貌代码表 c on a.zzmmID =b.id
left join 专业代码表 d on a.zyID =b.id