| 
1 
2 
3 
4 
5 | 
# IF 문법 
IF(조건, 조건이 True인 경우 반환할 값, 조건이 False인 경우 반환할 값) 
# Example 
INSERT INTO indiegame (`name`, `score`) VALUES (‘cutup’, '5000’) on duplicate key update indiegame.score = IF(indiegame.score < 5000, 5000, indiegame.score);  | cs | 
indiegame.score가 5000보다 낮으면 5000을 indegame.score에 넣는다.
만약 5000보다 높으면 기존 스코어를 유지한다.
 
댓글 없음:
댓글 쓰기