MySQL Forums
Forum List  »  Newbie

Re: Order By in FROM Subquery doesn't work in 5.7
Posted by: zhiren Yip
Date: April 17, 2016 12:54AM

the sql with no error , i get data from the DB . but in 5.7, i can't get the right data .the detail is in the subquery alies t2
SELECT  *
  FROM  `FlightOnTime`.`FlightOnTime`
  WHERE  (`FlightDate` BETWEEN '2016-04-01' AND '2016-04-14')
  AND  `DepAP` IN (SOMETHING)AND `Reg` IN (SOMETHING)
  ORDER BY  `FlightDate` DESC

with "ORDER BY `FlightDate` DESC"

becsuae i want to get the last row order by FlightDate .

execute the SQL above give me the right data .

but in the whole SQL , "ORDER BY `FlightDate` DESC" in t2 has no effect .

i already explan the SQL and found it no "order by" action in t2 .

i think this may be the setting problem in 5.7

Options: ReplyQuote


Subject
Written By
Posted
Re: Order By in FROM Subquery doesn't work in 5.7
April 17, 2016 12:54AM


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.