RE: Simple questio SQL

2007-09-05 Thread Wm Mussatto
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 Tota

Re: Simple questio SQL

2007-09-05 Thread Alex Arul Lurthu
select * from Products order by Visited desc limit 10; should give you the top 10 products. On 9/5/07, Tomas Abad <[EMAIL PROTECTED]> wrote: > > HI All, > > > > I have a Table and want to know the most visited products. > > > > Products > > - Id > > - Name > > -

RE: Simple questio SQL

2007-09-05 Thread Jay Blanchard
[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) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubs

Re: Simple questio SQL

2007-09-05 Thread Martijn Tonies
> 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, MySQ

Simple questio SQL

2007-09-05 Thread Tomas Abad
HI All, I have a Table and want to know the most visited products. Products - Id - Name - Visited Visited is numeric.