WeCode
Academy
Tutorials
Web Development
Bootstrap
CSS
HTML
JavaScript
jQuery
Node.js
PHP
React
TypeScript
Programming
C
C#
C++
Go
Java
Python
Rust
Data and Databases
NumPy
Pandas
SQL
Tools
Bash
Git
Projects
Project: A Tiny Shell in C
Project: Bank Account System
Project: Library Management System
Project: Portfolio Page
Project: Quiz App in React
Project: Sales Data Analysis
Project: Server Log Analyser
Project: To-Do REST API
Project: URL Shortener
Project: Word Counter in Four Languages
All tutorials ❯
Paths
References
Practice
Try it editor
Quizzes
How To recipes
Tools
Glossary
My Learning
🌙
Dark mode
Home
›
How To
›
SQL
Find duplicate values
Group by the column and keep groups with more than one row.
Example
sql
SELECT city, COUNT(*) AS n FROM customers GROUP BY city HAVING COUNT(*) > 1;
Run ❯
Reset
Open in editor »
More SQL recipes
Get the top N rows per query
Find rows with no match in another table
Calculate a running total
Pivot values into columns with CASE
Count rows per group