Modify the MYSQL statement. thank you ~ Select * from (select * fromcitywherenameslike '% xxx %' limit10) wherenameslike '$ xxx %' orderbynames error prompt: Everyderive modify MYSQL statement, thank you ~
Select * from (select * from city where names like '% xxx %' limit 10) where names like '$ xxx %' order by names
Error message: Every derived table must have its own alias
How should I change it?
------ Solution --------------------
Select * from (select * from city where names like '% xxx %' limit 10) where names like '$ xxx %' order by names
Analysis:
Select * from (table) is a table.
Select * from city where names like '% xxx %' limit 10 this obviously does not match, the difference is far away
So your sentence is obviously wrong.
------ Solution --------------------
I didn't go to verify (). can I put limit in it? but according to the error message, it should mean this.
Select * from (select * from city where names like '% xxx %' limit 10) t where names like '$ xxx %' order by names
------ Solution --------------------
Discussion
I didn't go to verify (). can I put limit in it? but according to the error message, it should mean this.
Select * from (select * from city where names like '% xxx %' limit 10) t where names like '$ xxx %' order by names
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service