SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: Getting top 10

  1. #1
    SitePoint Member
    Join Date
    Feb 2006
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting top 10

    How would i go about getting the top 10 entries for a certain month?
    eg. there are a hundred projects in my database (msql) and i would like to see which 10 were viewed the most during the last month...

    any help would be appreciated

    thx

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What have you tried doing so far? For a basic question like this you should be able to show that you have done some work on the query.

  3. #3
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,423
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    use LIMIT 10

    Can't be more helpful without seeing your table structure/query

  4. #4
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'd be more inclined to see whether or not this is a homework question and what has been done as far as the query goes before handing out an answer myself.

  5. #5
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also note you should post this in the general database forum if by msql you mean microsoft sql server or something rather than mysql since this is a mysql forum. Limit for instance only works in mysql and won't work for you if you are using something else.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •