Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

to get the most repeated column name  RSS feed

 
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
Sheriff
Posts: 37242
519
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
Boost this thread!