mysql模糊匹配运算符_MySQL 入门:运算符,运算顺序,模糊查询

Notes

SQL运行顺序: from ---> where -----> select

distinct 选择不同选项, 多列选择时保留combination不同的项。

2. * 查出全部列

3. x + null = null

4. 查null : is null, is not null

between : between A and B, A和B都包括。

5.模糊查询:

like '%X%'

like '%X'

like 'X%'

like'__x' /*一个下滑线代表一个字*/

Basic:

1.SELECT population FROM world

WHERE name = 'Germany';

2.SELECT name, population FROM world

WHERE name IN ('Sweden', 'Norway', 'Denmark');

3.SELECT name, area FROM world

WHERE area BETWEEN 200000 AND 250000;

Select from World

1.

SELECT name, continent, population FROM world

2.

select name as country from world where population >= 200000000;

3.

select name as country, GDP/population from world where population >= 200000000;

4.

select name population/1000000 from world where continent='South America';

注意:select XXX as.... as 后设置的为一个短语(>=2个词) 需单引号。 如population in million

5. IN 的用法

6.

7. 基本OR

8. XOR,Exclusive OR:(A条件+ B条件取反) or (A取反+ B条件)

9. round (XXXX, 保留几位小数)

注意运算顺序:population/10^2-----实际运算=(popualtion/10)^2

10.

11.Length: returns the number of characters in string s.

12. 选择AB不等的项。 A!= B; <>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值