Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Demo here
CREATE TABLE #CustomerTable (NoCust INT , LeasingName VARCHAR(100) , InsuranceName VARCHAR(100)) INSERT INTO #CustomerTable (NoCust , LeasingName , InsuranceName ) SELECT 00001,'PANIN','' UNION ALL SELECT 00002,'PANIN','BESS' UNION ALL SELECT 00003,'MEGA','BUANA' UNION ALL SELECT 00004,'CLIPAN','MUGI' SELECT CLIPAN , MEGA , PANIN FROM ( SELECT LeasingName , COUNT(*) Cnt FROM #CustomerTable GROUP BY LeasingName ) A PIVOT ( MAX(Cnt) FOR LeasingName IN ([CLIPAN],[MEGA],[PANIN]) )pvt SELECT [BESS],[BUANA],[MUGI] FROM ( SELECT InsuranceName , COUNT(*) Cnt FROM #CustomerTable GROUP BY InsuranceName ) A PIVOT ( MAX(Cnt) FOR InsuranceName IN ([BESS],[BUANA],[MUGI]) )pvt
run
|
edit
|
history
|
help
0
abhishek
Remove duplicates with in 10 min
FIGURA5.1
test1
Demo
TUAN 7_QLDT
Factorial
exp7
new problem SQL
Crea, confirma y despliega tablas