most occurances

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • meltedown

    most occurances

    I have a table called items with a field "brandid"

    I'm using mysql 3.23.58 which does not have COUNT();

    What statement can I use to find out which brandid occurs the most
    frequently?


  • meltedown

    #2
    Re: most occurances

    meltedown wrote:[color=blue]
    > I have a table called items with a field "brandid"
    >
    > I'm using mysql 3.23.58 which does not have COUNT();
    >
    > What statement can I use to find out which brandid occurs the most
    > frequently?
    >
    >[/color]
    I read in the manual that there is no COUNT() before 4.1.1, but I got
    this to work, so I don't know aht the problem was.

    $query2="SELECT brandid FROM items GROUP BY brandid ORDER BY COUNT(*)
    LIMIT 1";

    Comment

    Working...