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