|
两张表 T_resume_language,T_language_sort
第一张表有三个字段 第二章表是类别表
现在我想查询出来类别的名字是不是必须这样写三次啊。
有没有什么好的方法。这个看起来不怎么好看。
select languageId1 ,languageId2, languageId3
,(select a.cname from T_language_sort as a ,T_resume_language as b where a.code=b. languageId1 and b.[resumeid]=@id ) as language1,
(select a.cname from T_language_sort as a ,T_resume_language as b where a.code=b. languageId2 and b.[resumeid]=@id ) as language2,
(select a.cname from T_language_sort as a ,T_resume_language as b where a.code=b. languageId3 and b.[resumeid]=@id ) as language3
from T_resume_language as a where [resumeid]=@id |
|