首页 > 数据库技术 > 详细

Mysql 学习之路(三)Mysql基础知识之数据过滤

时间:2020-05-31 15:27:55      阅读:34      评论:0      收藏:0      [点我收藏+]

1.order_by

select * from products order_by salary desc;(倒叙)

select * from products order_by salary asc;

2.利用正则表达式

select * from products where name regexp ‘.000‘;

select * from products where name regexp ‘[123] 000‘;

3.利用函数

select upper(name) from products ;

select * from products where Year(order_date) = 2020 and Month(order_date) = 5;

select avg(salary) from products;(平均值)

select count(*) from products;(计数)

select max(salary) as min_salary from products;(最大值)

select sum(salary) as sum_salary from products;(求和)

 

Mysql 学习之路(三)Mysql基础知识之数据过滤

原文:https://www.cnblogs.com/peterWXM/p/12997854.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!