MySQL的简单查询语句

查询:

seclt * from table  查询所有

select name,name2,name3 from  查询指定返回的字段

根据条件查询:

select * from tableName where Code = 12  单条件查询

select * from tableName where code = 12 and cod2 = 12 多条件查询

select * from table where code = 12  or code = 13 条件或查询

select * from table where price >= 20 and price <=60 范围查询

select * from table where price btween 50 and 60 范围查询


模糊查询

select * from table where card like '%型'  %通配符


排序

select * from table where order by card 按照价格升序排列

五:统计函数(聚合函数)
select count(Code) from Car 查询表中有多少条数据
select max(Price) from Car 取价格的最大值
select min(Price) from Car 取价格的最小值
select sum(Price) from Car 取价格的总和
select avg(Price) from Car 取价格的平均值



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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值