ВНУТРЕННЯЯ ВСТУПЛЕНИЕ В МНОЖЕСТВЕННЫЕ КОЛОННЫ


0 принят
SELECT TB_DOCTORS.*, 
S1.SPECIALITY_NAME AS SPECIALITY_NAME1, 
S2.SPECIALITY_NAME AS SPECIALITY_NAME2, 
S3.SPECIALITY_NAME AS SPECIALITY_NAME3, 
S4.SPECIALITY_NAME AS SPECIALITY_NAME4 
FROM TB_DOCTORS 
LEFT OUTER JOIN TB_SPECIALTY S1 ON TB_DOCTORS.SPEC_ID1 = S1.SPECIALITY_ID 
LEFT OUTER JOIN TB_SPECIALTY S2 ON TB_DOCTORS.SPEC_ID2 = S2.SPECIALITY_ID 
LEFT OUTER JOIN TB_SPECIALTY S3 ON TB_DOCTORS.SPEC_ID3 = S3.SPECIALITY_ID 
LEFT OUTER JOIN TB_SPECIALTY S4 ON TB_DOCTORS.SPEC_ID4 = S4.SPECIALITY_ID 
SQL,

sql,

-2

Ответов: 1


0 принят
SELECT TB_DOCTORS.*, 
S1.SPECIALITY_NAME AS SPECIALITY_NAME1, 
S2.SPECIALITY_NAME AS SPECIALITY_NAME2, 
S3.SPECIALITY_NAME AS SPECIALITY_NAME3, 
S4.SPECIALITY_NAME AS SPECIALITY_NAME4 
FROM TB_DOCTORS 
LEFT OUTER JOIN TB_SPECIALTY S1 ON TB_DOCTORS.SPEC_ID1 = S1.SPECIALITY_ID 
LEFT OUTER JOIN TB_SPECIALTY S2 ON TB_DOCTORS.SPEC_ID2 = S2.SPECIALITY_ID 
LEFT OUTER JOIN TB_SPECIALTY S3 ON TB_DOCTORS.SPEC_ID3 = S3.SPECIALITY_ID 
LEFT OUTER JOIN TB_SPECIALTY S4 ON TB_DOCTORS.SPEC_ID4 = S4.SPECIALITY_ID 
SQL,
Похожие вопросы