0
setとwhereを使用して1つの列の値を更新したいとします。where句を含む複数のセット
私は
update Students set Studentid =case
when Studentid=1 then class= 10
when studentid = 3 then class=9
when studentid=2 and studentid =4 then class=8
End
のようなクエリを作ったが、私はそれが動作していないと思います。それで私を助けてください。
上記のクエリで達成したいことを記述できますか?クエリーは間違っていると思われます。 –
それは 'studentid'か' class'のyopuを変更したいのですか? –
あなたはどのレコードも 'studentid = 2 and studentid = 4'の基準に合致すると思いますか?レコードの「studentid」は、同時に2と4ではなく、2 *または* 4(または別の値)でもかまいません。したがって、「studentid = 2またはstudentid = 4」。 –