|
Two tables T_resume_language, T_language_sort
The first table has three fields. The second table is the category table.
Now I want to find out if the name of the category must be written three times like this.
Is there any good way. This doesn't look very good.
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 |
|