select sum(njts)-sum(ysyts) from njsyqk where ygdh='888882' and ((yxbz is null) or (yxbz='1')) select qjd_lsh,qjd_jqlx,qjd_sy,qjd_ygjs,jbxx_sszz from qjd q,ygjbxx y where q.qjd_ygbh=y.jbxx_bh and qjd_lsh=(select max(qjd_lsh) from qjd where qjd_ygbh='…
mysql 修改一列自增长 set @rownum=0; update a SET id = ( select @rownum := @rownum +1 as nid) WHERE id < 10; l mysql 查询重复数据及其条数 select login_name,count(*) as count from sys_user group by login_name having count>1; l mysql 查询一个表中没有存在在另一个表的数据 SELECT * FROM…
select lower('HELLO') from dual;select lpad(100, 5, '*') from dual;select sysdate + 1 / 24 from dual;select last_day(sysdate) from dual;select to_char(sysdate,'year-month-DD day HH24:MI:SS') from dual;…
整合了一下上学期学习的积累,希望可以帮到初学者! 可能以后会有用吧! A 基本语句的运用 操作基于emp表1.按工资从高到低排列SQL> select rownum as 次序,ename,sal 2 from (select ename,sal 3 from emp 4 order by sal desc) 5 where rownum<=5 6 ;2.做内嵌式图由大到小排序后找前五个的错误写法 SQL> select ename,sal 2 from emp …