Forum Moderators: coopster

Message Too Old, No Replies

Order by Desc Limit

Order by Desc Limit

         

JackieB

2:48 am on Apr 5, 2005 (gmt 0)

10+ Year Member



GROUP BY linkid ORDER BY hits DESC LIMIT 0, 4

Shouldn't this line pull 4 urls and descriptions?

There are 6 URLs on the site and it is showing all 6.

Thanks,
jackie

ajs83

2:51 am on Apr 5, 2005 (gmt 0)

10+ Year Member



did you try

GROUP BY linkid ORDER BY hits DESC LIMIT 4

?

JackieB

3:04 am on Apr 5, 2005 (gmt 0)

10+ Year Member



Thank you for the reply.

Its still returning all 6.

Jackie

JackieB

8:51 pm on Apr 6, 2005 (gmt 0)

10+ Year Member



it is still returning all 6. Does anyone know why either the code is broken or could something somewhere else be over riding the command?

Thanks,
Jackie

jatar_k

8:56 pm on Apr 6, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try dropping the GROUP BY

if there are only 6 then you could just have

select * from mytable ORDER BY hits DESC LIMIT 4

if that works then move on from there

JackieB

9:11 pm on Apr 6, 2005 (gmt 0)

10+ Year Member



There will be many more than 6, but at any time the most I need pulled is 4.

Thanks,
Jackie

coopster

12:05 pm on Apr 7, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Which database (and version), MySQL? Can you offer the full query statement here?