This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JDBC and the fly likes SQL query needed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL query needed" Watch "SQL query needed" New topic
Author

SQL query needed

Nagendra Shastry
Greenhorn

Joined: Oct 26, 2010
Posts: 19
Hi All,

I am a student on Computer Science and not having much knowledge. So please don't mind if my quesrion is silly.
I need to write a sql query to group by a column where column has duplicate values( having count more than one)
Please help me out.
T Mishra
Ranch Hand

Joined: Apr 04, 2006
Posts: 108

Hi Nagendra ,

It would be really helpful if you can tell us details about what you've tried so far and the problem you're facing.


Thanks,
Tushar (SCJP 1.5)
Shashank Gollapudi
Ranch Hand

Joined: Jan 19, 2012
Posts: 33
Hi Nagendra,

As per what i have understood,

Let x be the column you wanted to find duplicates on,

use group by clause on x then followed by having clause using the count function

For example: Select x from sometable group by x having count(x) > 1
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL query needed