![](http://dl.iteye.com/upload/attachment/435824/929ef3a3-1a7b-3300-b731-8e1823492eff.jpg)
insert into employee (id,position,xueli,emplyee_name) values(1,1,4,'杨忠宇');
就是说这个员工 是高中学历 职位是项目经理
怎样才能把他的个人信息查找出来的?
select a.emplyee_name,b.item_value,c.item_value
from employee a
join my_dictionary b on b.item_type = '职位' and a.position = b.id
join my_dictionary c on c.item_type = '学历' and a.xueli=c.id
where a.id=1;
如果有的员工没有学历 那么就用 left
select a.emplyee_name,b.item_value,c.item_value
from employee a
left outer join my_dictionary b on b.item_type = '职位' and a.position=b.id
left outer join my_dictionary c on c.item_type = '学历' and a.xueli=c.id
但是目前对 设计数据库字典表 好处还不是很了解。节省空间吗?