Есть ли способ обновить таблицу на основе предложения multiple where. В одном заявлении?Обновление tsql multipe на одной таблице
update A
set Final = '21'
from StudentTable A
where Student_ID= 4 and bitcm= 0 and receipt= 17
update B
set Final = '22'
from StudentTable B
where Student_ID=4 and bitcm= 0 and receipt =12
update C
set Final ='11'
from StudentTable C
where Student_ID=4 and bitcmp=1 and receipt=17
update D
set Final ='12'
from StudentTable D
where Student_ID=4 and bitcmp=1 and receipt=12
Есть ли способ объединить все это утверждение в одно утверждение?
Да. Наилучший подход зависит - есть ли другие строки для «Student_ID» 4, кроме 4, которые вы показали? –