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

广州做网站地方网站建设加盟代理

广州做网站地方,网站建设加盟代理,wordpress 微信朋友圈,扬州专注企业网站建设DQL数据查询语言 从数据表中提取满足特定条件的记录 1.单表查询 2.多表查询 查询基础语法 select 关键字后指定要查询到的记录的哪些列 语法#xff1a;select 列名#xff08;字段名#xff09;/某几列/全部列 from 表名 [具体条件]#xff1b; select colnumName…DQL数据查询语言 从数据表中提取满足特定条件的记录 1.单表查询 2.多表查询 查询基础语法 select 关键字后指定要查询到的记录的哪些列 语法select  列名字段名/某几列/全部列 from 表名 [具体条件] select colnumName1[colnumName2...] from tableName [where conditions]; select colnumName1[colnumName2...] from tableName [where conditions]; 如果要显示查询到的记录的所有列则可以使用 * 替代字段名列表项目开发中不建议使用* select * from stus; select * from stus; 总结  条件关系运算符 示例1 增删改操作 示例2查询表中某一列 示例3select * 查询表中所有列 示例4select * 表名 where 列名 限制条件 查询表中满足条件的所有数据项 查询表中time 20021104的数据 完整示例查询时间为20210723的数据  区间查询 select * from rebirth where 列名  between 数据项1 and 数据项2 between 查询期间的开始 and 查询期间的结束 条件逻辑运算符 在where子句中可以将多个条件通过逻辑运算and并且\or或者\not取反进行拼接通过多个条件来筛选要操作的数据。 and并且 or:或者 not取反 DQL数据查询语言 模糊查询 LIKE子句 在where子句的条件中我们可以使用like关键字来实现模糊查询 语法 select * from 表名 where 列名 like 模糊查询的关键字 是否包括o类似如此 select * from 表名 where 列名 like %模糊查询条件% select * from 表名 where 列名 like   %o%;          查询包含字母o的数据项 select from 表名 where 列名 like _o%;                查询第二个字母是o的数据项 x% 查询首字符为x的数据项 ‘%x 查询最后一个字符为x的数据项 对查询结果的处理 1.设置查询的列 声明显示查询结果的指定列 select 列名...from 表名 where 符合查询结果 select 列名1列名2 from 表名 查询所有查询列中数据 计算列 select 列名,某数值-列名 from 表名; as关键字 字段取别名 修改列名 select 列名某数值吧-列名 as 别名 from 表名 查询表中某列的所有数据 select 列名 from 表名 select distinct 列名 from 表名 distinct 去重关键字 去除重复的数据 2.查询排序结果 排序order by 将查询到的满足条件的记录按照指定的列的值升序/降序排列 select * from 表名 where 条件 order by 列名 升序/降序 升序排序  降序排序 字段排序 单字段排序  多字段排序 总结  #10.25#选择使用数据库 use fine;#创建数据表 create table rebirth(rebirth_name varchar(10) primary key,rebirth_happen varchar(20) not null,rebirth_time int(8) not null,rebirth_mood varchar(10),rebirth_go varchar(15) not null );#查询某表中所有列 select * from rebirth;#删除某项表 drop table if exists rebirth;#添加表数据 insert into rebirth(rebirth_name,rebirth_happen,rebirth_time,rebirth_mood,rebirth_go )values(lcl,意外,20210723,pain,insist );insert into rebirth(rebirth_name,rebirth_happen,rebirth_time,rebirth_mood,rebirth_go )values(lyc,意外,20230904,pain,hard );# 查询表中日期为20210723的数据 select * from rebirth where rebirth_time 20210723;#查询表中mood为pain的数据 select * from rebirth where rebirth_mood pain;#查询表中go为hard的数据 select * from rebirth where rebirth_go ! hard;#查询表中time 20021104的数据 select * from rebirth where rebirth_time 20021104;#查询time 11111111, 99999999的数据 select * from rebirth where rebirth_time between 11111111 and 99999999; #查询rebirth_happen意外且rebirth_moodpain select * from rebirth where rebirth_happen意外 and rebirth_moodpain;#查询rebirth_gohard或rebirth_namelcl select * from rebirth where rebirth_gohard or rebirth_namelcl;#查询rebirth_name‘lcl; select * from rebirth where not rebirth_name lcl;#查询rebirth_name中存在字符l的数据项 select * from rebirth where rebirth_name like %l%;#查询rebirth_happen中第二个字符是外 select * from rebirth where rebirth_happen like _外%;#查询rebirth_name中最后一个字符是c select * from rebirth where rebirth_name like %c;#查询rebirth_name中第一个字符是l select * from rebirth where rebirth_name like l%;#查询rebirth_name中第一个字符是l的数据的rebirth_name和rebirth_go两列 select rebirth_name,rebirth_go from rebirth where rebirth_name like l%;#查询rebirth列中rebirth_name和20231025-rebirth_time的列 select rebirth_name,20231025-rebirth_time from rebirth; #修改列名 select rebirth_name as 重生日,20231025-rebirth_time as 车祸日 from rebirth; #查询某表中的某一列 select rebirth_go from rebirth;#查询莫表中的某一列去除重复的项 select distinct rebirth_name from rebirth;#查询莫表中的某一列去除重复的项 select distinct rebirth_happen from rebirth;#查询排序数据结果 排序order by asc升序 desc降序 单字段排序 select * from rebirth where rebirth_time order by rebirth_time asc;#查询排序数据结果 排序order by asc升序 desc降序 单字段排序 select * from rebirth where rebirth_time order by rebirth_time desc;#查询排序数据结果 排序order by asc升序 desc降序 双排序排序 select * from rebirth where rebirth_time order by rebirth_go asc,rebirth_mood desc;#查询rebirth表 select * from rebirth ;
http://www.hkea.cn/news/14370151/

相关文章:

  • 重庆网站建立如何自己创网站
  • 南阳网站推广优化公司公众号免费素材网站
  • 岳阳网站开发收费权威发布公众号封面
  • 母婴网站建设布吉商城网站建设
  • 书画网站 建站松岗网站开发
  • 多行业品牌企业公司网站模板做美团网站需要多少钱
  • 域名备案需要网站吗建筑网站模板
  • 高清网站建设的好处抖音代运营违法吗
  • 网络推广网站培训网站全栰培训
  • 张家港网站建设优化wordpress无法访问站点
  • 做网站关键词必须要中文网址顺德区网站设计
  • 视频上传下载网站建设网站工信部实名认证中心
  • 网站平台建设包括哪些产品外观设计用什么软件
  • 然后建设一个论坛网站app制作流程图
  • 大连网站seo顾问中国做的比较好的电商网站有哪些
  • 做视频怎样传到网站品牌建设的六个步骤
  • wordpress网站排名千图网的设计风格
  • 永久免费网站推荐wordpress 修改页面链接地址
  • 永川做网站的wap建站程序源码
  • 北京便宜网站建设韩国互联网公司排名
  • asp网站开发工具神器成都php网站制作程序员
  • vi设计收费杭州 seo网站建设 网络服务
  • 北京网站建设 奥美通全网营销兰州做网站企业
  • 一站式做网站哪家好wordpress主题知更
  • iis搭建多个网站网站设计专业
  • 茂名网站制作策划宣传页在线设计软件
  • 一个网站如何做cdn加速器长沙公司有哪些
  • 网站建设预算和流程介绍优化网站性能
  • 开源企业网站源码网站备案没公司
  • 智慧团建网站入口pc端注册过什么网站