SQL 활용

SQL 활용3 1. 그룹핑 - 특정 컬럼을 기준으로 그룹을 나누어 모든 행을 하나의 그룹으로 편입시켜 그룹별로 집계할 때 사용 ※ ~별 ~결과를 본다 할 때, 자주 사용함 # Country 별로 회원수를 조회 (Count는 중첩 수) SELECT Country, COUNT(Country) FROM Customers GROUP BY Country; # Country별, City별 회원수를 조회 SELECT Country, City, COUNT(City) FROM Customers GROUP BY Country, City 2. HAVING - SELECT문의 순서 - FROM > WHERE > GROUP BY > HAVING > SELECT > ORDER BY - WHERE가 GROUP BY 보다 먼저 실행..
SQL의 활용2 ※ 샘플은 다음과 같은 사이트를 사용하였음 https://www.w3schools.com/mysql/trymysql.asp?filename=trysql_select_all MySQL Tryit Editor v1.0 WebSQL stores a Database locally, on the user's computer. Each user gets their own Database object. WebSQL is supported in Chrome, Safari, and Opera. If you use another browser you will still be able to use our Try SQL Editor, but a different version, usin www.w3school..
NewBean
'SQL 활용' 태그의 글 목록