This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

to get the most repeated column name

 
pavani potnuru
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic