|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
HI All,
I have a Table and want to know the most visited products. Products - Id - Name - Visited Visited is numeric. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
> I have a Table and want to know the most visited products.
> > > > Products > > - Id > > - Name > > - Visited > > > > Visited is numeric. How about: select * from Products order by Visited desc ? Martijn Tonies Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Oracle & MS SQL Server Upscene Productions http://www.upscene.com My thoughts: http://blog.upscene.com/martijn/ Database development questions? Check the forum! http://www.databasedevelopmentforum.com |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
[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) |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
select * from Products order by Visited desc limit 10; should give
you the top 10 products. On 9/5/07, Tomas Abad <informatica@vipventa.com> wrote: > > HI All, > > > > I have a Table and want to know the most visited products. > > > > Products > > - Id > > - Name > > - Visited > > > > Visited is numeric. > > -- Thanks Alex http://alexlurthu.wordpress.com |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|