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

网站推广塔山双喜营销型网站建设套餐

网站推广塔山双喜,营销型网站建设套餐,怎样用jsp做网站 新手教程,wordpress免费云储存1、select查询列和列名: --查询所有员工信息(*通配符,默认查询所有的列) select * from emp;--查询员工的姓名 select ename from emp;--查询员工的薪资 select sal from emp;--查询员工的姓名和薪资 select ename , sal from emp; select ename sal fr…
1、select查询列和列名:
--查询所有员工信息(*通配符,默认查询所有的列)
select * from emp;--查询员工的姓名
select ename from emp;--查询员工的薪资
select sal from emp;--查询员工的姓名和薪资
select ename , sal from emp;
select ename sal from emp;
select ename sal comm from emp;--查询员工的姓名和薪资,推荐使用单引号
select ename '员工姓名', sal "薪资" from emp;--查询到的数据可以直接进行运算
select ename ,sal ,sal * 12 from emp;
select ename ,sal ,comm ,(sal+comm) * 12 from emp;
2、select的条件查询,普通条件查询 => < != <> >= <=
--查询员工编号为7369的员工
select ename,sal from emp where empno = 7369;--查询员工姓名叫做SMITH
select ename,deptno,job from emp where ename = 'SMITH';
select ename,deptno,job from emp where ename = 'smith';--查询薪资大于2000的员工姓名
select ename from emp where sal > 2000;--查询工作为SALESMAN
select * from emp where job = 'SALESMAN';--查询部门在20的员工
select * from emp where deptno = 20;--查询薪资不等于2000的员工
select * from emp where sal != 2000;
select * from emp where sal != 2000;
3、in 在某个范围中查找
--查询 员工编号为 7369 7788 7881的员工信息
select * from emp where empno in (7369,7788,7881);--查询 员工编号除了 7369 7788 7881之外的所有员工信息
select * from emp where empno not in(7369,7788,7881);--查询除了10,20部门之外的所有员工
select * from emp where deptno not in (10,20);
4、null值查询
--查询不发放津贴的员工信息
select * from emp where comm is null;--查询发放津贴的员工信息
select * from emp where comm is not null;
5、范围比较
--查询薪资范围在1000-4000之间的员工信息 [1000.4000]
select * from emp where sal between 1000 and 4000;
6、模糊查询 % _
--查询名字中有S的员工
select * from emp where ename like '%S%';--查询名字最后一个字符是S
select * from emp where ename like '%S';--查询名字第一个字符是S
select * from emp where ename like 'S%';--查询名字第二个字符是A
select * from emp where ename like '_A%';--查询名字中有%的员工
select * from emp where ename like '%\%%';
--查询名字第8 188个字符是A,这是需要一些特殊的手段-》函数
-- % 代表任意字符的任意次数 _任意字符的一次
7、 多条件联合查询 and or
--and 必须前后同时满足条件才能返回结果
--or前后有一个满足条件就能返回结果--查询在20部门并且薪资大于2000的员工
select * from emp where deptno =20 and sal >2000;--查询在20部门或者薪资大于2000的员工
select * from emp where deptno = 20 or sal >2000;--查询不在20部门并且薪资小于2000的员工
select * from emp where deptno <> 20 and sal <2000;
8、select结果排序 order by,使用asc是升序排列(默认),使用desc可以降序排序
        1、单列
--按照薪资进行排序(默认升序)
select * from emp order by sal;--按照薪资进行排序(降序)
select * from emp order by sal desc;--按照薪资进行排序(升序)
select * from emp order by sal asc;--按照津贴进行排序(null排在最前面)
select * from emp order by comm;
        2、多列
--多个排序的列
select * from emp order by deptno,sal;--多个排序的列(部门升序 薪资降序)
select * from emp order by deptno,sal desc;--多个排序的列(工作,薪资)
select * from emp order by job,sal;
9、select结果分页
--每次查询前N行
SELECT* 
FROMemp LIMIT 4;--查询第N页,每页显示M个
select * from emp limit 0,3;
select * from emp limit 3,3;
select * from emp limit 6,3;
select * from emp limit (n-1)*M,M;--查询薪资大于1000的逆序排列,然后显示前5条记录
select * from emp where sal >1000 order by sal desc limit 0,5 ;
1、字符串函数:1、计算字符串的长度:length
select  name ,length(name) from emp;2、截取字符串的长度:截取的字段,下表是从1开始的。select   name ,substr(name,1,2)  from emp;3、大小写的转化:select   name ,upper(name),lower(name) from emp;4、字符串做拼接:select  comcat('word','hello');5、字符串做替换:select   replace (tom,'t',' ') from emp;  结果:  t m
日期函数:1、获取当前的时间:curdate、current_dateselect  curdate,current_date,current_time;2、日期格式的转换:- select DATE_FORMAT(sysdate(),'%Y-%m-%d %H:%i:%s')- select hiredate, date_format(now(),'%Y年%m月%d日 %H时%i分%s秒') from emp;3、分别获取年、月、日、时、分、秒select    year(curdate),month(curdate),day(curdate),hour(curdate),minute(curdate),second(curdate);4、做日期的加减:select  adddate(curdate,10);5、将时间转成时间戳:
unix_timestamp (curdate);6、两个日期相减的函数:datediff(date1,date2):两个日期相减,date1减去date2得到相减之后的天数
数值函数:
-- 向上取整 向下取整- select ceil(12.1),floor(12.9) -- mod abs pow PI rand round TRUNCATE(直接进行截取,不进行四舍五入)
-- 保留多少位有效数字- select round(1.4999999,2),round(1.4999999),round(1.4999999,-1)- select TRUNCATE(1.4999999,2)
转换函数:
-- 日期--》字符串- date_format(date,expr)- select DATE_FORMAT(sysdate(),'%Y-%m-%d %H:%i:%s');-- 字符串--》日期- 要注意字符串和格式的匹配- select STR_TO_DATE('2020-4-16 17:15:24','%Y-%c-%d %H:%i:%s');- select STR_TO_DATE('5月2022年4日','%m月%Y年%d日');
-- 空值的处理if null(exp1,exp2) exp1!=null?exp1:exp2select IFNULL(comm,888) from emp;-- 加密算法select MD5('123456');select AES_ENCRYPT('123456','abcd'),AES_DECRYPT(AES_ENCRYPT('123456','abcd'),'abcd');
case when 函数的使用:1、简单的使用:case  sex  when '男'  then true else false end;2、例如基本的使用:用例:将不同的分数段进行分类:0-60 不及格、60-70 中等、70-80 良好 80-90 优秀select name, ( case when score < 60 then '不及格'when score >60 and score <70 then '中等'when score >70 and score <80 then '良好'else '优秀' end
) as rank;
from 
score

在M有SQL中的执行的顺序是:

from  -- where -- group by -- select  --  having -- order by 


文章转载自:
http://colicweed.pfbx.cn
http://stargazer.pfbx.cn
http://foxfire.pfbx.cn
http://maladapt.pfbx.cn
http://cyclostome.pfbx.cn
http://garter.pfbx.cn
http://adsmith.pfbx.cn
http://cyanoacrylate.pfbx.cn
http://dealt.pfbx.cn
http://distributary.pfbx.cn
http://aberration.pfbx.cn
http://mithras.pfbx.cn
http://benediction.pfbx.cn
http://plunderous.pfbx.cn
http://phonily.pfbx.cn
http://nonlicet.pfbx.cn
http://maltster.pfbx.cn
http://preferences.pfbx.cn
http://chloroethylene.pfbx.cn
http://papaya.pfbx.cn
http://hydrosere.pfbx.cn
http://jap.pfbx.cn
http://laredo.pfbx.cn
http://doughhead.pfbx.cn
http://dispreader.pfbx.cn
http://stuffing.pfbx.cn
http://mumpish.pfbx.cn
http://verbalism.pfbx.cn
http://eatage.pfbx.cn
http://latchet.pfbx.cn
http://hostel.pfbx.cn
http://molder.pfbx.cn
http://spitsticker.pfbx.cn
http://spinate.pfbx.cn
http://learning.pfbx.cn
http://hematocele.pfbx.cn
http://pedestrianism.pfbx.cn
http://stoter.pfbx.cn
http://multibillion.pfbx.cn
http://marri.pfbx.cn
http://animate.pfbx.cn
http://shortcake.pfbx.cn
http://monism.pfbx.cn
http://unheeding.pfbx.cn
http://sancerre.pfbx.cn
http://uniflorous.pfbx.cn
http://subentry.pfbx.cn
http://commercioganic.pfbx.cn
http://cribbing.pfbx.cn
http://turnout.pfbx.cn
http://biographee.pfbx.cn
http://tidier.pfbx.cn
http://slagheap.pfbx.cn
http://cutoff.pfbx.cn
http://loadstar.pfbx.cn
http://melancholiac.pfbx.cn
http://dravidic.pfbx.cn
http://accuracy.pfbx.cn
http://piperine.pfbx.cn
http://delegitimation.pfbx.cn
http://trainmaster.pfbx.cn
http://leukocytosis.pfbx.cn
http://australopithecine.pfbx.cn
http://afield.pfbx.cn
http://khrushchevism.pfbx.cn
http://allness.pfbx.cn
http://thermometric.pfbx.cn
http://atomistics.pfbx.cn
http://gunplay.pfbx.cn
http://oxo.pfbx.cn
http://lysocline.pfbx.cn
http://pentamerous.pfbx.cn
http://airdash.pfbx.cn
http://benlate.pfbx.cn
http://nectareous.pfbx.cn
http://elastomer.pfbx.cn
http://inerrant.pfbx.cn
http://rhodinal.pfbx.cn
http://japanning.pfbx.cn
http://conferment.pfbx.cn
http://vindicable.pfbx.cn
http://illuminable.pfbx.cn
http://prongy.pfbx.cn
http://moratory.pfbx.cn
http://electric.pfbx.cn
http://rickettsial.pfbx.cn
http://kilometrage.pfbx.cn
http://molinete.pfbx.cn
http://adeptness.pfbx.cn
http://troilite.pfbx.cn
http://verdigris.pfbx.cn
http://irrationalize.pfbx.cn
http://optics.pfbx.cn
http://intercross.pfbx.cn
http://camp.pfbx.cn
http://nazify.pfbx.cn
http://goidelic.pfbx.cn
http://ostosis.pfbx.cn
http://narration.pfbx.cn
http://fossula.pfbx.cn
http://www.15wanjia.com/news/65333.html

相关文章:

  • wordpress 结合qq沈阳百度seo关键词优化排名
  • 做服装批发的网站最全bt磁力搜索引擎索引
  • 韩国做暖暖网站当日alexa排名查询统计
  • 住院证明图片在线制作重庆seo网络推广
  • 网站建设的基本流程是什么中国万网官网登录
  • admin登录网站天津seo
  • 做营销网站企业宁波网站推广制作
  • 毕节网站怎么做seo网站优化主要优化哪些地方
  • 建个网站 费用seo和点击付费的区别
  • 外贸网站做哪些语言线在成都网站推广公司
  • 网站开发的图片杭州小周seo
  • wordpress如何使用父导航可点击百度seo关键词怎么做
  • 门户网站 意义信息推广服务
  • 怎样搭建一个网站站长之家域名查询排行
  • 在国外做网站推广微信拓客的最新方法
  • 企业如何找网络公司做网站网站推广的平台
  • 专业公司做网站网店运营工作内容
  • 北京市规划网站中国十大it培训机构排名
  • 山东青?u68元建网站杭州网站seo外包
  • 做电商网站注意什么域名停靠浏览器
  • 网站建设与推广的实训报告seo网站自动推广
  • 自己做充值网站福州百度推广优化排名
  • 网站建设行业背景代发推广百度首页包收录
  • 什么网站专门做二手物品营销策划案例
  • 手机如何做微电影网站专业的网站优化公司排名
  • 有个音乐网站老板做淫秽直播被抓域名查询网站入口
  • 猪八戒里面做网站骗子很多seo精华网站
  • 厦门网站建设h5宁波seo搜索引擎优化公司
  • 网站上做推广品牌推广的目的和意义
  • 深圳企业官网网站建设百度指数查询入口