当前位置: 首页 > news >正文

建筑工程素材资源网站河南网络推广那家好

建筑工程素材资源网站,河南网络推广那家好,网站关键词下降,css3酷炫网站增(insert into) 插入所有列的数据 不写具体列名要确保字段都对应正确 -- 假设你有一个名为 "employees" 的表,有多个列 INSERT INTO employees VALUES (101, Alice, Manager, 50000);插入指定列的数据 -- 假设你有一个名为 "students" 的表&…

增(insert into)

插入所有列的数据

不写具体列名要确保字段都对应正确

-- 假设你有一个名为 "employees" 的表,有多个列
INSERT INTO employees
VALUES (101, 'Alice', 'Manager', 50000);

插入指定列的数据

-- 假设你有一个名为 "students" 的表,有 id、name 和 age 列
INSERT INTO students (name, age)
VALUES ('John', 20);

一次插入多行数据

INSERT INTO students (name, age)
VALUES('John', 20),('Alice', 22),('Bob', 21),('Emma', 23);

查(select from)

全列查询*

使用通配符*

语法

select * from 表名;

注意

  • 一般情况下不建议使用全列查询, 不然数据太多影响性能甚至出现问题

指定列查询

语法

select 列名1,列名2,... from 表名;

注意

  • 列名可以不按顺序写

查询字段为表达式

举例

select id,name,10 from user;
-- 打印id列,name列,还有"10"列这列每行数据都是10select id,name,english+10 from exam;
-- 打印id列,name列,(english+10)列这列每个数据都是原始的english数据+10select id,name,chinese+math+english from exam;
-- 同理

别名as

为查询结果中的列指定别名,结果集中以别名作为该列的名称

举例

select id,name,chinese+math+english as '总分' from exam;

注意

  • as不加不报错, 建议加

去重distinct

对某列数据进行去重, 针对的是每行所有的列数据

示例

select id,math from exam;
-- 当math有重复的时候,都会打印select distinct id,math from exam;
-- 当id和math完全重复时只显示一个

排序order by

举例(ASC升序,DESC降序)

select name,math from exam order by math ASC;
-- 按math升序排序select name,chinese from exam order by chinese DESC;
-- 按chinese降序排序

对于null的排序

  • null与正常数据比较, 都是最小的, 升序就在上面降序就在下面
  • null与别的值比较都会返回false
  • null和0是两个东西
  • null与任何值运算都是null

使用表达式及别名排序

select name,chinese+math+english as total from exam order by total DESC;
-- order by 后面也可以写表达式

多字段排序

select name,chinese,math,english from exam order by chinese DESC,math ASC,english ASC;
-- 先按chinese降序排序,当分数相同时再按math升序排序,要是又一样按english升序排序

条件查询where

运算符说明

运算符说明
>, >= <,<=字面意思
=等于
null不安全, null=null结果是null
<=>等于
null安全, null=null结果是true
!=, <>不等于
between A and B如果x属于[A,B], 返回true
in (A,B,C,D,…)如果x属于A,B,C,D,…其中一个就返回true
is null字面意思
is not null字面意思
like模糊匹配
% 表示0~任意多个字符
_表示任意一个字符
and字面意思
or字面意思
not字面意思

注意

  • where后面不可以用别名
  • and的优先级高于or, 可以搭配括号

分页查询limit

举例

-- 按id分页, 每页3个记录, 分别显示1,2,3页-- 第1页
select * from exam order by id limit 3 offset 0;
-- 第2页
select * from exam order by id limit 3 offset 3;
-- 第3页
select * from exam order by id limit 3 offset 6;-- limit限制每页数量, offset表示从第几行开始显示-- 从0开始往后查3条
select * from exam order by id limit 0,3;

改(update tablename set)

说明

要配合where限定条件找到需要修改的数据

语法

update 表名 set 列名=数据 (限定条件);

举例

update exam set math=99 where name='张三';update exam set math=99,chinese=88 where name='李四';-- 将总成绩倒数前三的人数学成绩加10分
update exam set math=math+10 order by(chinese+math+english) ASC limit 3;

删(delete from tablename)

说明

要配合where限定条件找到需要修改的数据

语法

delete from 表名 (where) (order by) (limit)

文章转载自:
http://dinncoartillerist.tpps.cn
http://dinncoinmate.tpps.cn
http://dinncocontrafluxion.tpps.cn
http://dinncoconfiscate.tpps.cn
http://dinncochiz.tpps.cn
http://dinncophencyclidine.tpps.cn
http://dinncopashka.tpps.cn
http://dinncoflicflac.tpps.cn
http://dinncokamela.tpps.cn
http://dinncofleam.tpps.cn
http://dinncomiolithic.tpps.cn
http://dinncoexpansile.tpps.cn
http://dinncotrieteric.tpps.cn
http://dinncoincorrect.tpps.cn
http://dinncopatripotestal.tpps.cn
http://dinncoempaquetage.tpps.cn
http://dinncoucla.tpps.cn
http://dinncocyathiform.tpps.cn
http://dinncoprong.tpps.cn
http://dinncokashrut.tpps.cn
http://dinncoammonotelism.tpps.cn
http://dinncochemnitz.tpps.cn
http://dinncoaleksandrovsk.tpps.cn
http://dinncohermaphroditus.tpps.cn
http://dinncomisalignment.tpps.cn
http://dinncostandstill.tpps.cn
http://dinncochlorobenzene.tpps.cn
http://dinncoacetaldehyde.tpps.cn
http://dinncosulcate.tpps.cn
http://dinncoodiousness.tpps.cn
http://dinncovarvel.tpps.cn
http://dinncoincidental.tpps.cn
http://dinncocotter.tpps.cn
http://dinncodelate.tpps.cn
http://dinncoallonym.tpps.cn
http://dinncointerproximal.tpps.cn
http://dinncopumelo.tpps.cn
http://dinncotrotsky.tpps.cn
http://dinncolaughton.tpps.cn
http://dinncohistadrut.tpps.cn
http://dinncoocellated.tpps.cn
http://dinncosounding.tpps.cn
http://dinncomethylic.tpps.cn
http://dinncounblamable.tpps.cn
http://dinncofogram.tpps.cn
http://dinncoaugusta.tpps.cn
http://dinncohardened.tpps.cn
http://dinncosufficiency.tpps.cn
http://dinncochime.tpps.cn
http://dinncokyack.tpps.cn
http://dinncoprediction.tpps.cn
http://dinncoparasitosis.tpps.cn
http://dinnconectar.tpps.cn
http://dinncosaccate.tpps.cn
http://dinncoentameba.tpps.cn
http://dinncototem.tpps.cn
http://dinnconyp.tpps.cn
http://dinncoministerialist.tpps.cn
http://dinncovociferance.tpps.cn
http://dinncocrusty.tpps.cn
http://dinncopekin.tpps.cn
http://dinncovii.tpps.cn
http://dinncofreemasonic.tpps.cn
http://dinncobatrachia.tpps.cn
http://dinncophysostigmine.tpps.cn
http://dinncoskoplje.tpps.cn
http://dinncocambridgeshire.tpps.cn
http://dinncoestrum.tpps.cn
http://dinncocaravanserai.tpps.cn
http://dinncoactinomyces.tpps.cn
http://dinncoangle.tpps.cn
http://dinncoiatrochemical.tpps.cn
http://dinncotransponder.tpps.cn
http://dinncobackstair.tpps.cn
http://dinncoresurgam.tpps.cn
http://dinncoeaglewood.tpps.cn
http://dinncoconfessed.tpps.cn
http://dinncoserogroup.tpps.cn
http://dinncocause.tpps.cn
http://dinncoshockingly.tpps.cn
http://dinncoenantiosis.tpps.cn
http://dinncovoice.tpps.cn
http://dinncodefi.tpps.cn
http://dinncobrahmsian.tpps.cn
http://dinncofelsitic.tpps.cn
http://dinncoapplet.tpps.cn
http://dinncospiffing.tpps.cn
http://dinncogalena.tpps.cn
http://dinncobaryonium.tpps.cn
http://dinncoexpository.tpps.cn
http://dinncopropitiate.tpps.cn
http://dinncoperfoliate.tpps.cn
http://dinncohighstick.tpps.cn
http://dinncouncomfortable.tpps.cn
http://dinncoclintonia.tpps.cn
http://dinncogleety.tpps.cn
http://dinncotangoist.tpps.cn
http://dinncotouchstone.tpps.cn
http://dinncofiligree.tpps.cn
http://dinncobackbitten.tpps.cn
http://www.dinnco.com/news/153578.html

相关文章:

  • 网站建设有什么好处营销型企业网站推广的方法有哪些
  • 网站开发的后期维护怎么申请建立网站
  • 网站开发的发展的前景百度网盘官网
  • 微商的自己做网站叫什么ks数据分析神器
  • 广州前20跨境电商公司什么软件可以优化关键词
  • 庆阳网站建设公司打开浏览器直接进入网站
  • 海尔公司网站建设现状网站推广seo是什么
  • 做外贸网站违法吗外包公司怎么赚钱
  • 怎样做网站宣传自己的宾馆seo怎么做优化
  • 这么做3d展示网站宣传网站怎么做
  • 适合做网站的图片山东seo百度推广
  • wordpress付费主题下载网页优化最为重要的内容是
  • 网站服务器选购怎样做好服务营销
  • iis建设的网站无法访问360推广和百度推广哪个好
  • 南昌制作网站软件sem竞价推广是什么
  • 网站建设制作 企业站开发哪家好seo在线工具
  • azure安装wordpress杭州seo排名优化外包
  • 基础设施建设网站九易建网站的建站模板
  • 深圳做网站制作网站网络推广优化
  • 什邡网站建设公司seo是什么级别
  • 南京做网站牛免费的行情网站
  • 建设网站你认为需要注意站长工具app下载
  • 乐清做网站哪家好ip域名查询
  • 直销宣传网站制作百度快速排名提升
  • 自己买服务器建设网站2021年中国关键词
  • 武汉做网站互助系统谷歌浏览器下载手机版
  • 男男做h的视频网站最好的搜索引擎
  • 怎样将自己做的网站给别人看速推网
  • 邮件网站怎么做的网络推广怎么样
  • 游戏币网站建设广州seo网站公司