Quick SQL Reference – Find Duplicate Data In A Table Using Having Clause

Problem Statement: You have a table with duplicate data (say a name) in a column. Find how many times a name occurs in that column.

Simple SQL Solution:

SELECT OBJECT_NAME NAME,
COUNT(OBJECT_NAME) MYCOUNT
FROM GENERALDB.JAVAOBJECTS
GROUP BY OBJECT_NAME
HAVING COUNT(OBJECT_NAME)>0

In above SQL
Table Name = javaobjects
Database Name = generaldb

Here is the original data on a sample table:

Here is the results of running the query on the sample table above.

[My Video Promotion]
  1. Java Object Serialization and Deserialization In MySQL Database
  2. How To Set Conditional Debug Breakpoints in Eclipse or IBM RAD?
  3. Rotating An Image In Java Graphics 2D By Specified Degree
  4. How to setup and run the Microsoft’s Command Line BCP Utility Without Installing SQL Server Client?
  5. Utility Class For Getting SQL Connection and Closing It
  6. Dropping Stored Procedure and Granting Execute Permission
  7. Finding MAX length of the data in DB column
  8. SQL – How To Find The Physical Location Of MySQL Database (Data Location)
  9. Java – How To Overlay One Image Over Another Using Graphics2D [Tutorial]
  10. Quick SQL Reference – Find Duplicate Data In A Table Using Having Clause
  11. Splitting PDF File Using Java iText API Into Multiple PDFs
  12. Object Serialization And De-Serialization In Java To Filesystem
  13. Finding Java Image Pixels Information – ARGB (Alpha, Red, Green Blue)
  14. Creating A 3D Pie Chart In Java Using JFreeChart [Example Source Code]
  15. Java Tutorial – Swing Text Drag And Drop – Sample Example
  16. 005: MySQL – Selecting a set of random rows from a table
  17. Serialzing A Java Object Into XML and De-Serialzing using XMLEncoder And XMLDecoder
  18. SQL – Finding Nth Highest Row In DB Table
  19. Six Stages Of Debugging in Software Engineering
  20. Java 2D Graphics Example Tutorial On Paint, Gradient and Stroke
  21. Complete Tutorial On Using SOAP-UI to Mock Web Service Request / Response
  22. Listing The Content Of Zip File With Zip Information In Java
  23. Joke – Why do Java Programmers wear glasses?
  24. How to receive files via bluetooth in your MacBook Pro
  25. SQL – How To Retrieve Data With Maximum Length?
  26. Calculating Folder Size Graphically and Generating Directory Size Chart In Java
Tagged , , , , , , , . Bookmark the permalink.

6 Responses to Calculating Folder Size Graphically and Generating Directory Size Chart In Java

  1. nocdib says:

    Thank you for this! It is just what I need

  2. d says:

    would that help you tocreate the file from ubunt server

  3. komal gaikwad says:

    in this code i got problem of array out of bound plz tell me solution.

  4. komal gaikwad says:

    In this code i got error
    Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 1
    plz send me proper code….

  5. Neethu says:

    Thank you very much for the solution. This is the one which i was searching.

  6. Manikant says:

    I need to copy to the shared folder which is shared and can be authenticate by using credentials.

    but here the code is giving to write .

    I need copy my folder from my local to shared location

    Please help

Leave a Reply to d Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.