Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
Use 3 cases where1) id is max 2)id is even 3)id is odd
SELECT CASE WHEN ID = (SELECT MAX(ID) FROM COUNTRY_DIRECTORY) THEN ID WHEN MOD(ID, 2) = 1 THEN ID + 1 ELSE ID-1 END AS ID, COUNTRYFROM COUNTRY_DIRECTORYORDER BY ID;
Great!!!! That is the expected solution.. Keep it up and try other problems to improve your SQL skills
Use 3 cases where
1) id is max
2)id is even
3)id is odd
SELECT CASE
WHEN ID =
(SELECT MAX(ID)
FROM COUNTRY_DIRECTORY) THEN ID
WHEN MOD(ID,
2) = 1 THEN ID + 1
ELSE ID-1
END AS ID,
COUNTRY
FROM COUNTRY_DIRECTORY
ORDER BY ID;
Great!!!! That is the expected solution.. Keep it up and try other problems to improve your SQL skills