MYSQL 산술 연산자
로빈아빠
본문
※ 덧셈
mysql > select 1+2+3;
+-----------
| 1+2+3
+-----------
| 6
+-----------
1 row in set (0.00.sec)
※ 뺄셈
mysql > select 10-3;
+-----------
| 10-3
+-----------
| 7
+-----------
1 row in set (0.00.sec)
※ 곱하기
mysql > select 2*3;
+-----------
| 2*3
+-----------
| 6
+-----------
1 row in set (0.00.sec)
※ 나누기
mysql > select 2/2;
+-----------
| 2/2
+-----------
| 1.00
+-----------
1 row in set (0.00.sec)
※ 나머지
mysql > select 2%3;
+-----------
| 2%3
+-----------
| 3
+-----------
1 row in set (0.00.sec)
출처 : http://qdata.co.kr/bo/bbs/board.php?bo_table=myt&wr_id=28
mysql > select 1+2+3;
+-----------
| 1+2+3
+-----------
| 6
+-----------
1 row in set (0.00.sec)
※ 뺄셈
mysql > select 10-3;
+-----------
| 10-3
+-----------
| 7
+-----------
1 row in set (0.00.sec)
※ 곱하기
mysql > select 2*3;
+-----------
| 2*3
+-----------
| 6
+-----------
1 row in set (0.00.sec)
※ 나누기
mysql > select 2/2;
+-----------
| 2/2
+-----------
| 1.00
+-----------
1 row in set (0.00.sec)
※ 나머지
mysql > select 2%3;
+-----------
| 2%3
+-----------
| 3
+-----------
1 row in set (0.00.sec)
출처 : http://qdata.co.kr/bo/bbs/board.php?bo_table=myt&wr_id=28
관련링크
댓글목록
등록된 댓글이 없습니다.