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 EXCEL相关
这次的需求是在二次扫描的EXCEL报表中加入一列扫描时间. 扫描的时间之前已经写进日志里了,这次要做的就是把时间读取出来然后作为一列插入报表.其实日志也已经读出来了,要做的就是插入.但插入还是碰到不少 ...
- yii2.0下,JqPaginator与load实现无刷新翻页
JqPaginator下载地址http://jqpaginator.keenwon.com/ 控制器部分: <?php namespace backend\controllers; use co ...
- Netty-promise
public class TimeEncoder extends ChannelOutboundHandlerAdapter { @Override public void write(Channel ...
- oracle查询语句大全 oracle 基本命令大全
oracle查询语句大全 oracle 基本命令大全 来源于:http://download.csdn.net/download/jia584643753/5875619 1.create user ...
- Spark Mllib里如何将数据取消暂存在内存中(图文详解)
不多说,直接上干货! 具体,见 Hadoop+Spark大数据巨量分析与机器学习整合开发实战的第18章 决策树回归分类Bike Sharing数据集
- JS中实现JSON对象和JSON字符串之间的相互转换
对于主流的浏览器(比如:firefox,chrome,opera,safari,ie8+),浏览器自己提供了JSON对象,其中的parse和stringify方法实现了JSON对象和JSON字符串之间 ...
- WPF 动态加载主题由zip
经典主题的方式 主题战略 加载速度 本机支持 (不需要额外的代码) 支持代码为主题 (捆绑代码 & 资源成单独的文件) 支持资源层次结构中导航 动态加载 动态卸载 轻松地编辑和编译 (不需要安 ...
- https的网站使用百度地图的问题
https的网站使用百度地图,如果你引用的地址没写对的话,加载不出来百度地图,被认为是不安全的JS内容. 引用的地址:http://api.map.baidu.com/api?v=2.0&ak ...
- restful之http讲解
HTTP(HyperText Transfer Protocol)是一套计算机通过网络进行通信的规则.计算机专家设计出HTTP,使HTTP客户(如Web浏览器)能够从HTTP服务器(Web服务器)请求 ...
- The first step in solving any problem is recognizing there is one.
The first step in solving any problem is recognizing there is one.解决问题的第一步是要承认确实存在问题.