Forum Moderators: open

Message Too Old, No Replies

Limiting Problem ,Need help!

         

canabatz

1:05 pm on Oct 17, 2008 (gmt 0)

10+ Year Member



i got this code that returning wrong results:

SELECT bid_price, count(*) as n from bidding_details where bid_id=$bid_id GROUP BY bid_price DESC HAVING n = 1
UNION ALL
SELECT bid_price, count(*) as d from bidding_details where bid_id=$bid_id GROUP BY bid_price DESC HAVING d > 1
limit $eu, $limit

the limit is working only on the first query ,the second query is running after the first limit ,so if i got 30 results from the first query and 30 results from the second query ,all will be displayed on the first page

if the first query got 50 results the next query will be displayed in the next page!

this is my first post in this forum :) ,im happy to be with you all!

thanx in davanced!