File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
The Java EE 7 Tutorial Volume 1 or Volume 2
this week in the
jQuery UI in Action
to get the most repeated column name
Joined: Nov 04, 2007
Feb 19, 2008 05:05:00
I have lot of products ordered by the user.Some of them are repeated.
How to get the most 5 frequently ordered products from the column named Product.
Joined: May 26, 2003
Feb 19, 2008 16:23:00
This query gives you the number of each distinct products. You want to add a clause to get the first 5 rows. This part varies by database.
select product, count(*) as "num" from products order by num desc
How To Ask Questions The Smart Way
Blogging on Certs:
SCEA Part 1
Part 2 & 3
Core Spring 3
TOGAF part 1
I agree. Here's the link:
subject: to get the most repeated column name
Checking a string
Am I ready?
SQL for the top 2 most recurring values in a column
displaying the most highly repeated entry in an ArrayList
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014