group by
-
Real MySQL 8.0 4 - 쿼리 작성 및 최적화책책책 책을 읽읍시다/프로그래밍 2023. 5. 1. 22:45
MySQL 연산자와 내장 함수 숫자 숫자 값을 상수로 SQL에 사용할 때는 다른 DBMS와 마찬가지로 따옴표(' 또는 ") 없이 숫자 값을 입력하면 된다. 또한 문자열 형태로 따옴표를 사용하더라도 비교 대상이 숫자 값이거나 숫자 타입의 컬럼이면 MySQL 서버가 문자열 값을 숫자 값으로 자동 변환한다. 하지만 이처럼 숫자 값과 문자열 값을 비교할 때는 한 가지 주의할 사항이 있다. 서로 다른 타입으로 WHERE 조건 비교가 수행되는 다음 쿼리를 잠깐 살펴보자. SELECT * FROM tab_test WHERE number_cloumn='10001'; SELECT * FROM tab_test WHERE string_cloumn=10001; 위 쿼리와 같이 두 비교 대상이 문자열과 숫자 타입으로 다를 때는..