im using paging on this query:
i got this code that returning wrong results:
[CODE=sql](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 "; [/CODE]
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!
what im doing wrong?
thanx in davanced!
i got this code that returning wrong results:
[CODE=sql](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 "; [/CODE]
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!
what im doing wrong?
thanx in davanced!
Comment