HI All,
I have a Table and want to know the most visited products.
Products
- Id
- Name
- Visited
Visited is numeric.
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,
[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
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
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