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.

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, MySQL, NexusDB,

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

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 - Visited

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 Total_Visits