--- id: sql-max title: "SQL Max" category: "Database" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["SQL MAX() Function", "MAX function", "SQL μ΅œλŒ“κ°’"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.9 created_at: 2026-07-04 updated_at: 2026-07-04 review_reason: "" merge_history: [] tags: ["sql", "database", "w3schools", "max", "aggregate"] raw_sources: ["https://www.w3schools.com/sql/sql_max.asp"] applied_in: [] github_commit: "" --- # [[SQL Max]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) MAX() returns the largest value in a column across numeric, string, or date types, mirroring MIN() in syntax and usage. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **MAX() function** β€” returns the largest value of the selected column; works with numeric, string, and date data types. [S1] - **Syntax** β€” `SELECT MAX(column_name) FROM table_name WHERE condition;`. [S1] - **Unnamed result** β€” needs an `AS` alias to name the returned column. [S1] - **MAX() with GROUP BY** β€” returns the largest value per group. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) - Highest price: `SELECT MAX(Price) FROM Products;`. [S1] - With alias: `SELECT MAX(Price) AS HighestPrice FROM Products;`. [S1] - On a date column: `SELECT MAX(BirthDate) AS LatestBirthdate FROM Employees;`. [S1] - With GROUP BY: `SELECT MAX(Price) AS HighestPrice, CategoryID FROM Products GROUP BY CategoryID;`. [S1] ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) μ†ŒμŠ€μ—μ„œ λͺ¨μˆœλ˜λŠ” μ •λ³΄λŠ” λ°œκ²¬λ˜μ§€ μ•ŠμŒ. ## πŸ› οΈ 적용 사둀 (Applied in summary) ν˜„μž¬ 발견된 μ‹€μ œ 적용 사둀가 μ—†μŠ΅λ‹ˆλ‹€ β€” MIN()κ³Ό 짝을 이뀄 λ²”μœ„(μ΅œμ†Œ~μ΅œλŒ€) λ¦¬ν¬νŠΈμ— 자주 ν•¨κ»˜ 쓰인닀. [S1] ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) MAX with alias and GROUP BY (SQL): ```sql SELECT MAX(Price) AS HighestPrice, CategoryID FROM Products GROUP BY CategoryID; ``` ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.90 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[SQL Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[SQL Aggregate Functions]], [[SQL Min]], [[SQL Group By]] - **μ°Έμ‘° λ§₯락:** μ΅œλŒ“κ°’ μ‘°νšŒκ°€ ν•„μš”ν•œ λͺ¨λ“  리포트의 κΈ°λ³Έ ν•¨μˆ˜ β€” MIN()κ³Ό λŒ€μΉ­ 관계. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” SQL MAX() Function β€” https://www.w3schools.com/sql/sql_max.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-07-04: Initial draft synthesized from the W3Schools "SQL MAX() Function" page (Astra wiki-curation, P-Reinforce v3.1 format).