MySQL Forums
Forum List  »  Newbie

order by doesn't work for multi table selection for 5.1.43
Posted by: connie wang
Date: February 23, 2010 12:31PM

Not sure if this is related to the version or not but it worked for me up to yesterday and I believe mysql was updated yesterday by the host server.

I tried both implicit and explicit join statements to select from multiple table and order the results by a column from one of the tables.

If I take out "Order by l.price', it works.


The statements I tried are:

select d.*, u.*, l.* from detail as d,listing as l,user as u,payment as p
where d.userid=l.userid and u.userid=l.userid and p.userid=u.userid
order by l.price

select d.*, u.*, l.* from detail as d inner join listing as l on d.userid=l.userid inner join user as u on u.userid=d.userid
inner join payment as p on p.userid=d.userid
order by l.price

Both returned the warning:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource.
with "order by l.price" in the query but if I take that out, I get good results.

Thanks, connie



Edited 1 time(s). Last edit at 02/23/2010 12:27PM by connie wang.

Options: ReplyQuote


Subject
Written By
Posted
order by doesn't work for multi table selection for 5.1.43
February 23, 2010 12:31PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.