Files
2nd/10_Wiki/Dev/Topic_SQL/SQL_Select_Distinct.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

3.3 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
sql-select-distinct SQL Select Distinct Database draft conceptual
SQL SELECT DISTINCT Statement
DISTINCT keyword
SQL 중복 제거
B 0.9 2026-07-04 2026-07-04
sql
database
w3schools
distinct
select
https://www.w3schools.com/sql/sql_distinct.asp

SQL Select Distinct

🎯 한 줄 통찰 (One-line insight)

SELECT DISTINCT returns only unique values from a column, collapsing duplicate rows that a plain SELECT would otherwise repeat. [S1]

🧠 핵심 개념 (Core concepts)

  • SELECT DISTINCT — returns only distinct (unique) values, removing duplicate rows from the result. [S1]
  • SyntaxSELECT DISTINCT column1, column2, ... FROM table_name;. [S1]
  • COUNT(DISTINCT column) — counts the number of unique values in a column, but is not supported in Microsoft Access. [S1]

🧩 추출된 패턴 (Extracted patterns)

  • Dedup-then-count workaround — for databases lacking COUNT(DISTINCT ...) (e.g. MS Access), wrap a SELECT DISTINCT subquery and COUNT(*) the outer result: SELECT Count(*) AS DistinctCountries FROM (SELECT DISTINCT Country FROM Customers);. [S1]

📖 세부 내용 (Details)

  • Without DISTINCT, a query returns the column's value from every record, including repeats: SELECT Country FROM Customers;. [S1]
  • With DISTINCT, only unique values are returned: SELECT DISTINCT Country FROM Customers;. [S1]
  • Counting unique values directly: SELECT COUNT(DISTINCT Country) FROM Customers; — not supported on MS Access, which needs the subquery workaround above. [S1]

⚖️ 모순 및 업데이트 (Contradictions & updates)

  • DBMS 차이: COUNT(DISTINCT column_name)이 MS Access에서는 지원되지 않는다는 점이 명시적으로 언급됨 — 방언별 차이가 존재. [S1]

🛠️ 적용 사례 (Applied in summary)

현재 발견된 실제 적용 사례가 없습니다 — 이후 COUNT() 챕터에서 DISTINCT와의 조합이 더 다뤄진다. [S1]

💻 코드 패턴 (Code patterns)

Select unique values (SQL):

SELECT DISTINCT Country FROM Customers;

Count unique values, MS Access-safe (SQL):

SELECT Count(*) AS DistinctCountries
FROM (SELECT DISTINCT Country FROM Customers);

검증 상태 및 신뢰도

  • 상태: draft
  • 검증 단계: conceptual
  • 출처 신뢰도: B (W3Schools — widely used educational reference, not a primary standards body)
  • 신뢰 점수: 0.90
  • 중복 검사 결과: 신규 생성 (New discovery)

🔗 지식 그래프 (Knowledge Graph)

  • 상위/루트: SQL Tutorial
  • 관련 개념: SQL Select, SQL Count, SQL Group By
  • 참조 맥락: SELECT 결과의 중복을 제거해야 할 때 참조하는 문서 — COUNT()와 결합해 고유값 개수를 셀 때 자주 함께 쓰인다.

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-07-04: Initial draft synthesized from the W3Schools "SQL SELECT DISTINCT Statement" page (Astra wiki-curation, P-Reinforce v3.1 format).