[HackerRank SQL] Occupations
5582 단어 hackerranksqlmysqlhackerrank
문제 link
https://www.hackerrank.com/challenges/occupations/problem
Code link
https://github.com/JamesJung01/Hackerrank_sql/blob/main/02_Medium/Occupations.sql
SET @R1=0, @R2=0, @R3=0, @R4=0; SELECT MIN(DOCTOR), MIN(PROFESSOR), MIN(SINGER), MIN(ACTOR) FROM ( SELECT CASE WHEN OCCUPATION = 'DOCTOR' THEN (@R1 := @R1 + 1) WHEN OCCUPATION = 'PROFESSOR' THEN (@R2 := @R2 + 1) WHEN OCCUPATION = 'SINGER' THEN (@R3 := @R3 + 1) WHEN OCCUPATION = 'ACTOR' THEN (@R4 := @R4 + 1) END AS ROWNUMBER, CASE WHEN OCCUPATION = 'DOCTOR' THEN NAME END AS DOCTOR, CASE WHEN OCCUPATION = 'PROFESSOR' THEN NAME END AS PROFESSOR, CASE WHEN OCCUPATION = 'SINGER' THEN NAME END AS SINGER, CASE WHEN OCCUPATION = 'ACTOR' THEN NAME END AS ACTOR FROM OCCUPATIONS ORDER BY NAME ) TEMP GROUP BY ROWNUMBER;
Author And Source
이 문제에 관하여([HackerRank SQL] Occupations), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@jamesjung12/HackerRank-SQL-Occupations저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)