
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
- Weather Observation Station
- 몰누피라비르
- HK이노엔
- 넷플릭스
- Tableau
- SQL Server
- 테슬라
- TSQL
- 분석탭
- DATABASE
- 미중무역전쟁
- 경구치료제
- python3
- 매매일지
- 리비안
- MS SQL Server
- 대원화성
- 넥스트BT
- 코로나19
- list
- 에코캡
- MSSQL
- string
- 동국알앤에스
- mysql
- python
- tensorflow
- 해커랭크
- hackerrank
- insert
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |