2023-04-05 SQL
sql 명령어 깔끔하게 정리해주는 사이트 https://www.dpriver.com/pp/sqlformat.htm create table pivottest ( username char(3), season charpivottest(2), amount int); insert into pivottest values ('김범수', '겨울', 10), ('윤종신', '여름', 15),('김범수', '가을', 25), ('김범수', '봄', 37), ('윤종신', '겨울', 40),('김범수', '여름', 14), ('김범수', '겨울', 22), ('윤종신', '여름', 64); select *from pivottest; -- 피벗 형식으로 조회하기 : sum(),if() ,groupby select userna..
2023. 4. 5.