w3resource_MySQL练习:Basic_select_statement
w3resource_MySQL练习题:Basic_select_statement
-- 要点:as设置别名,as可省略 select first_name as "First Name", last_name as "Last Name" from employees
-- 要点:select时添加distinct获取唯一值 select distinct department_id from employees
-- 要点:order by进行排序,desc进行降序排序 select * from employees order by first_name desc
-- 要点:select中可以进行数学运算 select first_name, last_name, salary, salary*0.15 as PF from employees
-- 要点:order by + asc select employee_id, first_name, last_name, salary from employees order by salary asc
-- 要点:sum()加总 select sum(salary) from employees
-- 要点:max() + min() select max(salary), min(salary) from employees
-- 要点:avg()均值 + count()计数 select avg(salary), count(*) from employees
-- 要点:count() select count(*) from employees
-- 要点:count() + distinct select count(distinct job_id) from employees
-- 要点:upper() select upper(first_name) from employees
-- 要点:left()从左开始取字符 select left(first_name, 3) from employees
-- 要点:select可直接计算 select 171*214+625
-- 要点:concat()两列字符串组合 select concat(first_name, ' ', last_name) from employees
-- 要点:trim()去除两边空格 select trim(first_name) from employees
-- 要点:length()计算长度 select length(first_name)+first_name(last_name) from employees
-- 要点:where里使用 REGEXP 实现正则效果 select * from employees where first_name REGEXP '[0-9]'
-- 要点:limit限制取数量 select * from employees limit 10
-- 要点:round()实现小数位控制 select first_name, last_name, round(salary/12, 2) as 'Monthly Salary' from employees
w3resource_MySQL练习:Basic_select_statement的更多相关文章
- w3resource_MySQL练习:Joins
w3resource_MySQL练习题:Joins 1. Write a query to find the addresses (location_id, street_address, city, ...
- w3resource_MySQL练习:Subquery
w3resource_MySQL练习题:Subquery 1. Write a query to find the name (first_name, last_name) and the salar ...
- w3resource_MySQL练习: Aggregate_functions
w3resource_MySQL练习题:Aggregate_functions 1. Write a query to list the number of jobs available in t ...
随机推荐
- php数组生成树结构数据返回
现在有这样一个数组,要求按照树结构返回(当pid=0就表示其为菜单id,否则pid的值就是其属于某个菜单id下面): $array = array( 1 => array ('id' => ...
- response返回字符床
response.getWriter().println() 本来一个html,JSP等WEB资源返回的就是一个String,只是有时候这个String是符合html格式的,而刚是浏览器接收的了,所以 ...
- Spring Task ABC
配置说明 <task:annotation-driven scheduler="xxxScheduler" /> <task:scheduler id=" ...
- Java基础:(一)数据类型
一.包装类型 基本类型都有对应的包装类型,基本类型与其对应的包装类型之间的赋值使用自动装箱与拆箱完成. 八个基本类型:boolean/1:byte/8:char/16:short/16:int/32: ...
- JAVA---spring-boot入门(图文教程)
Spring Boot可以轻松创建独立的,生产级的基于Spring的应用程序,他的特征: 1.创建独立的Spring应用程序 2.直接嵌入Tomcat,Jetty或Undertow(无需部 ...
- 【js类库Raphaël】使用raphael.js根据点坐标绘制平滑曲线
一.可供参考的文档资料. raphaeljs官网:http://raphaeljs.com/ w3c关于path的介绍:http://www.w3.org/TR/2003/REC-SVG11-200 ...
- uvm_reg_predictor——寄存器模型(十一)
保存寄存器的值 观察DUT寄存器值的变化. //---------------------------------------------------------------------------- ...
- UML的九种模型图
本文转自UML 的九种模型图,仅供学习交流! 一.作为一种建模语言,UML的定义包括UML语义和UML表示法两个部分. UML语义:描述基于UML的精确元模型定义. UML表示法:定义UML符号的表示 ...
- VMware虚拟机中red hat linux ping不通宿主物理主机原因
在VMware Workstation中安装了red hat enterprise linux系统,网络使用“桥接”形式,最后出现在Windows下能够Ping通虚拟主机,而虚拟主机Ping不通Win ...
- 一键部署基于GitLab的自托管Git项目仓库
https://market.azure.cn/Vhd/Show?vhdId=9851&version=11921 产品详情 产品介绍GitLab https://about.gitlab.c ...