Categories:
.NET (961)
C (387)
C++ (185)
CSS (84)
DBA (8)
General (31)
HTML (48)
Java (641)
JavaScript (220)
JSP (109)
JUnit (31)
MySQL (297)
Networking (10)
Oracle (562)
Perl (48)
Perl (9)
PHP (259)
PL/SQL (140)
RSS (51)
Software QA (28)
SQL Server (5)
Struts (20)
Unix (2)
Windows (3)
XHTML (199)
XML (59)
Other Resources:
How To Count Duplicated Values in a Column
How To Count Duplicated Values in a Column? - Oracle DBA FAQ - Understanding SQL SELECT Query Statements
✍: FYIcenter.com
If you have a column with duplicated values, and you want to know what are those duplicated values are and how many duplicates are there for each of those values, you can use the GROUP BY ... HAVING clause as shown in the following example. It returns how many duplicated first names in the employees table:
SQL> SELECT first_name, COUNT(*) FROM employees GROUP BY first_name HAVING COUNT(*) > 1; FIRST_NAME COUNT(*) -------------------- ---------- Peter 3 Michael 2 Steven 2 John 3 Julia 2 William 2 Karen 2 Kevin 2 ......
2007-04-20, 4553👍, 0💬
Popular Posts:
What is test metrics? Test metrics accomplish in analyzing the current level of maturity in testing ...
How do you locate the first X in a string txt? A) txt.find('X'); B) txt.locate('X'); C) txt.indexOf(...
Describe in detail Basic of SAO architecture of Remoting? For these types of questions interviewer e...
How do we enable SQL Cache Dependency in ASP.NET 2.0? Below are the broader steps to enable a SQL Ca...
What will be printed as the result of the operation below: #define swap(a,b) a=a+b;b=a-b;a=a-b; void...