Pivot the Occupation column in OCCUPATIONS so that each Name is sorted alphabetically and displayed underneath its corresponding Occupation. The output column headers should be Doctor, Professor, Singer, and Actor, respectively. Note: Print NULL when there are no more names corresponding to an occupation. Input Format The OCCUPATIONS table is described as follows: Occupation will only contain on..
PIVOT 구문은 ROW로 출력된 결과를 COLUMN으로 변환시키는 역할을 한다. 예를 들어, 아래 쿼리는 연도별, 주문ID별, 주문수량의 합계를 출력한다. 결과를 보면 주문ID별로 2011, 2012, 2013, 2014 이렇게 4개의 ROW로 출력되어 한 눈에 확인이 어려운 느낌이다. SELECT CONVERT(VARCHAR(4), DueDate, 112) [DueYEAR] , LEFT(PurchaseOrderID,1) [PurchaseOrderID] , SUM(OrderQty) [OrderQty] FROM [AdventureWorks2014].[Purchasing].[PurchaseOrderDetail] GROUP BY CONVERT(VARCHAR(4), DueDate, 112) , LEFT(Pur..
- Total
- Today
- Yesterday
- mysql
- TSQL
- 분석탭
- tensorflow
- DATABASE
- 넷플릭스
- python3
- MS SQL Server
- 넥스트BT
- Tableau
- MSSQL
- Weather Observation Station
- 몰누피라비르
- 매매일지
- insert
- list
- 대원화성
- hackerrank
- 경구치료제
- string
- SQL Server
- 코로나19
- python
- 동국알앤에스
- HK이노엔
- 해커랭크
- 테슬라
- 미중무역전쟁
- 에코캡
- 리비안
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |