选择某表的某列从某表
select tablesname.column from tables;
选择某表的某列从某库的某表
select tablesname.column from database.tables
选择某表从某列按照某列的顺序
select column from database order by column;
选择多列从某表按照某两列排序
select column1,column2,c3 from database order by column1,column2;
选择多列从某表按照某列降序排序
select column1,column2,c3 from database order by column1 desc;
选择多列从某表按照某列降序排序后再按照某列顺序排序
select column1,column2,c3 from database order by column1 desc,column2;
查询某行从某表以某行排序取最值
select column from tables order by column1 desc limit 1;
本文转载自:精准像素:11px.cn ,感谢作者分享实用知识