Jump to content
СофтФорум - всё о компьютерах и не только

Присвоить категорию аудитории по следующему условию:если Аудитория кратна 4 то КомпКласс если Аудитория кратна 5 то Лаборатория Аудитория кратна 4 и 5 то АктовыйЗал у меня остаюстся пустые значение


wtfus1n
 Share

Recommended Posts

SELECT DISTINCT classroom
, case
when (classroom%4)=0 and (classroom%5)=0 then 'Актовый зал'
when (classroom%4)=0 and (classroom%5)<>0 then 'КомпКласс'
when (classroom%5)=0 and (classroom%4)<>0 then 'Лаборатория'
end 'Название'
from Schedule Sh

Link to comment
Share on other sites

Простите,  не совсем понятно,  какие пустые значения. 

Кстати,  у вас избыточные проверки: выбор работает так: если условие выполняется,  то выходит сразу на конец. Т. е. вы проверили на 4 и 5 сразу,  потом уже не надо проверять на неравенство. Это избыточный код,  хоть и не ошибочный. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...