| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Wm Mussatto | Date: | September 5 2007 4:02pm |
| Subject: | RE: Simple questio SQL | ||
| View as plain text | |||
On Wed, September 5, 2007 7:17, Jay Blanchard said: > [snip] > I have a Table and want to know the most visited products. > Products > > - Id > > - Name > > - Visited > [/snip] > > SELECT Id, Name, count(Visited) AS Total_Visits FROM product GROUP > BY(Id) order by Total_Visits desc limit 5 That should get you the top 5 from most to least visited. ------ William R. Mussatto Systems Engineer http://www.csz.com 909-920-9154
| Thread | ||
|---|---|---|
| • Simple questio SQL | Tomas Abad | 5 Sep |
| • Re: Simple questio SQL | Martijn Tonies | 5 Sep |
| • RE: Simple questio SQL | Jay Blanchard | 5 Sep |
| • Re: Simple questio SQL | Alex Arul Lurthu | 5 Sep |
| • RE: Simple questio SQL | Wm Mussatto | 5 Sep |
