e9cbf23ab5
이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영. - Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들 (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거. - Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/ Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/ Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이 존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존). - Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/ JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동. - 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리. - Topic_Programming 최종 문서 수: 2784 → 3985.
3.3 KiB
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 |
|
B | 0.9 | 2026-07-04 | 2026-07-04 |
|
|
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]
- Syntax —
SELECT 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 aSELECT DISTINCTsubquery andCOUNT(*)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)
- [S1] W3Schools — SQL SELECT DISTINCT Statement — https://www.w3schools.com/sql/sql_distinct.asp
📝 변경 이력 (Change history)
- 2026-07-04: Initial draft synthesized from the W3Schools "SQL SELECT DISTINCT Statement" page (Astra wiki-curation, P-Reinforce v3.1 format).