SQL 36

[SQL] 이스케이프 문자(Escape Character)

# 이스케이프 문자이스케이프 문자(Escape Character): 특정 특수 문자를 문자 그대로 인식하도록 지정하는 데 사용하는 문자SQL에서 특정 문자(예: %, _)는 특수한 기능을 가지며, 이를 본래 문자 그대로 처리해야 할 때 이스케이프(Escape) 처리가 필요하다.이스케이프 문자는 SQL에서 특수 문자의 기본 기능(예: _와 %의 와일드카드 기능)을 비활성화하여 해당 문자를 문자 그대로 검색하거나 사용할 수 있도록 도와준다.이스케이프 처리시, ESCAPE 절로 지정되며, 일반적으로 백슬래시(\)가 사용된다. # 이스케이프 문자가 필요한 경우파일 이름, URL, 경로 탐색경로에 언더스코어가 포함된 데이터를 검색할 때.예: /my_folder/file_name.특수 문자를 포함한 문자열 검색이메..

SQL 2024.12.06

[SQL] solvesql Advent of SQL 2024 5일차

# 링크solvesql Advent of SQL 2024: https://solvesql.com/collections/advent-of-sql-2024/ https://solvesql.com/collections/advent-of-sql-2024/ solvesql.com5일차 - 언더스코어(_)가 포함되지 않은 데이터 찾기: https://solvesql.com/problems/data-without-underscore/ https://solvesql.com/problems/data-without-underscore/ solvesql.com # 풀이SELECT DISTINCT page_locationFROM gaWHERE page_location NOT LIKE '%\_%' ESCAPE '\'ORDER ..

[SQL] solvesql Advent of SQL 2024 4일차

# 링크solvesql Advent of SQL 2024: https://solvesql.com/collections/advent-of-sql-2024/ https://solvesql.com/collections/advent-of-sql-2024/ solvesql.com4일차 - 지자체별 따릉이 정류소 개수 세기: https://solvesql.com/problems/count-stations/ https://solvesql.com/problems/count-stations/ solvesql.com # 풀이SELECT     local,     COUNT(*) AS num_stationsFROM stationGROUP BY localORDER BY num_stations ASCSELECT~:local 컬..

[SQL] solvesql Advent of SQL 2024 3일차

# 링크solvesql Advent of SQL 2024: https://solvesql.com/collections/advent-of-sql-2024/ https://solvesql.com/collections/advent-of-sql-2024/ solvesql.com 3일차 - 제목이 모음으로 끝나지 않는 영화: https://solvesql.com/problems/film-ending-with-consonant/ https://solvesql.com/problems/film-ending-with-consonant/ solvesql.com # 풀이SELECT titleFROM filmWHERE rating IN ('R', 'NC-17') AND SUBSTR(title, -1, 1) NOT IN (..

[SQL] solvesql Advent of SQL 2024 2일차

# 링크solvesql Advent of SQL 2024: https://solvesql.com/collections/advent-of-sql-2024/ https://solvesql.com/collections/advent-of-sql-2024/ solvesql.com2일차 - 펭귄 조사하기: https://solvesql.com/problems/inspect-penguins/ https://solvesql.com/problems/inspect-penguins/ solvesql.com# 풀이SELECT DISTINCT  species,  islandFROM penguinsORDER BY  island ASC,  species ASCSELECT DISTINCT~: species, island 컬럼의 고유..

[SQL] solvesql Advent of SQL 2024 1일차

# 링크solvesql Advent of SQL 2024: https://solvesql.com/collections/advent-of-sql-2024/ https://solvesql.com/collections/advent-of-sql-2024/ solvesql.com 1일차 - 크리스마스 게임 찾기: https://solvesql.com/problems/find-christmas-games/ https://solvesql.com/problems/find-christmas-games/ solvesql.com # 풀이SELECT game_id, name, yearFROM gamesWHERE name LIKE '%Christmas%' OR name LIKE '%Santa%'SELECT~: game..

728x90