Blog

[MySQL]03 select문에서 count()의 활용

Author
Summary
select 문에서 데이터 갯수를 셈
Category
Study
Tags
Database
Favorite
Memory Date
2023/08/04
Cross Reference Study
Related Media
Related Thought
Related Lessons
tag
날짜
작성자
진행상황
진행 전
태그구분
6 more properties
count는 데이터의 갯수를 세어주는 문법이다.
users 테이블의 name 컬럼 필드들의 갯수를 세는 문구이다.
select count(name) from users;
갯수는 데이터 관리자나, 테스트과정에서 확인 할 때 유용하다.
두번째 핵심은 필터로 보여줄때, 연관된 연산 이 필요할 경우 count를 통해 수많은 데이터 중 갯수만을 연산용 변수로 추출 할 수 있는 점이다.