books 테이블

if함수 pages 가 300보다크면 long 아니면 short로 나오게 하고 싶다.

select *, if(pages >= 300, 'long', 'short')
from books;

 

+ Recent posts