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 ...
随机推荐
- Identity Service
Identity Service - 解析微软微服务架构eShopOnContainers(二) 接上一篇,众所周知一个网站的用户登录是非常重要,一站式的登录(SSO)也成了大家讨论的热点.微软在 ...
- Dev控件工具箱安装
安装目录\Components\Tools,打开命令行 安装DEV工具 $ ToolboxCreator.exe /ini:toolboxcreator.ini 移除DEV工具 $ ToolboxCr ...
- c#基础值类和引用类型
//值类型:int double char decimal bool enum struct //引用类型:string 数组 自定义类 集合 object 接口 值传递传递的值得本身 引用传递传递的 ...
- 采用React+Ant Design组件化开发前端界面(一)
react-start 基础知识 1.使用脚手架创建项目并启动 1.1 安装脚手架: npm install -g create-react-app 1.2 使用脚手架创建项目: create ...
- 在docker上centos7 编译安装php7
docker镜像来自daocloud.io/library/centos 首先下载libmcrypt库并make && make install yum -y install gcc ...
- DHTMLX 使用汇总
1.dhtmlxGrid 底部总出现滚动条 ------------------------------------------ 发现使用DHTMLXGRID时 GRID 底边总有 滚动条 测试 ...
- Java 反射机制(一)
阅读<Core Java Volume I --- Fundamentals>反射部分,总觉得许多概念艰涩难懂.模棱两可.我想造成这个结果的主要原因可能是Cay S. Horstmann和 ...
- sizeof(int)
sizeof()操作符检测的是系统为后面()中的类型.变量等分配的内存空间的字节数,这里()中是int,就是求系统为int类型的变量分配几个字节. 在16位int平台下是2:在32位int平台下是4: ...
- C#调用SAP S4/HANA Gateway Service
公司使用SAP,并且实施公司做了一些提供报表数据的接口供调用,首先说明一下我对SAP不熟悉 但SAP用到的接口信息提供大家参考一下,这些Gateway Service使用的是DCP方式写的,SAP提供 ...
- POJ 2411 Mondriaan's Dream (状压DP,骨牌覆盖,经典)
题意: 用一个2*1的骨牌来覆盖一个n*m的矩形,问有多少种方案?(1<=n,m<=11) 思路: 很经典的题目,如果n和m都是奇数,那么答案为0.同uva11270这道题. 只需要m个b ...