SQL常用的查询语句

2019-04-30  本文已影响0人  fulen

1.1 增加字段

1、ALTER TABLE  Site add birthday date
2、ALTER TABLE  Site add title 
image.png

2.1 删除字段

ALTER TABLE Site DROP COLUMN hah 

3.1 查询表

select *from Instrument
image.png

3.2 查询count

1、select count(status) from instrument where status = 1 // 查询表中status = 1的条数
2、select *from (select count(0) from Instrument where status = 0),(select count(review) from Instrument where review = 1) // 查询表中多个字段的count

count 括号内的字符可以随便,不要有空格就行

image.png

4.1 改字段

上一篇 下一篇

猜你喜欢

热点阅读