posted @ 2019-01-12 17:40
学亮编程手记
阅读(2517)
推荐(0)
posted @ 2019-01-12 12:37
学亮编程手记
阅读(344)
推荐(0)
摘要:
package cn.zhangxueliang.mybatis.mapper; import static org.junit.Assert.*; import java.io.InputStream; import java.util.List; import org.apache.ibatis.io.Resources; import org.apache.ibatis.sessio...
阅读全文
posted @ 2019-01-12 11:55
学亮编程手记
阅读(688)
推荐(0)
posted @ 2019-01-01 19:56
学亮编程手记
阅读(251)
推荐(0)
posted @ 2019-01-01 19:42
学亮编程手记
阅读(204)
推荐(0)
摘要:
只需要将非group by字段放进函数中即可:
阅读全文
posted @ 2018-12-30 19:43
学亮编程手记
阅读(1400)
推荐(0)
摘要:
要根据id查询商品数据,需要从请求的参数中把请求的id取出来。Id应该包含在Request对象中。可以从Request对象中取id。 如果想获得Request对象只需要在Controller方法的形参中添加一个参数即可。Springmvc框架会自动把Request对象传递给方法。 1.1.1 默认支
阅读全文
posted @ 2018-12-27 21:21
学亮编程手记
阅读(12730)
推荐(0)
摘要:
--无条件循环 declare v_num number:=1; begin loop dbms_output.put_line(v_num); v_num:=v_num+1; exit when v_num>100; end loop; end; --有条件循环 declare v_num number:=1; begin while v_num<=100 loop dbms_...
阅读全文
posted @ 2018-12-24 21:31
学亮编程手记
阅读(178)
推荐(0)
posted @ 2018-12-24 21:14
学亮编程手记
阅读(156)
推荐(0)
posted @ 2018-12-24 21:07
学亮编程手记
阅读(242)
推荐(0)
posted @ 2018-12-24 21:04
学亮编程手记
阅读(162)
推荐(0)
posted @ 2018-12-24 20:58
学亮编程手记
阅读(186)
推荐(0)
摘要:
--创建表空间 create tablespace waterboss datafile 'd:\waterboss.dbf' size 100m autoextend on next 10m; --创建用户 create user wateruser identified by 011220 default tablespace waterboss; --用户赋权 grant dba to...
阅读全文
posted @ 2018-12-23 16:56
学亮编程手记
阅读(258)
推荐(0)
摘要:
windows下Oracle很不稳定,搞不好就给崩了,花很长时间去捣腾,还不如卸了重装。 1.停止所有服务 2.找到这个路径,点击卸载 或者 3.点击卸载产品 4.卸载成功后,点击取消退出 卸载成功后,点击取消退出 5.在注册表中删除以下指定的key 删除HKEY_LOCAL_MACHINE/SOF
阅读全文
posted @ 2018-12-23 16:38
学亮编程手记
阅读(19530)
推荐(0)
posted @ 2018-12-23 15:05
学亮编程手记
阅读(6522)
推荐(0)
posted @ 2018-12-23 15:03
学亮编程手记
阅读(1938)
推荐(0)
摘要:
--查看历史数据 select * from test1 as of timestamp to_timestamp('2018-12-23 14:41:00', 'yyyy-mm-dd hh24:mi:ss'); --开启可移动数据命令 alter table test1 enable row movement; --查看flashback功能是否开启 为no表示未开启 select open_...
阅读全文
posted @ 2018-12-23 14:53
学亮编程手记
阅读(2304)
推荐(1)
摘要:
--ddd:一年中的第几天 select to_char(sysdate,'ddd') from dual --d:一周中的第几天 星期天是第一天 所以要-1select to_char(sysdate-1,'d') from dual --dd:一月中的第几天select to_char(sysd
阅读全文
posted @ 2018-12-23 14:34
学亮编程手记
阅读(1883)
推荐(0)
摘要:
springmvc配置文件的主要内容:
阅读全文
posted @ 2018-12-18 22:53
学亮编程手记
阅读(615)
推荐(0)
posted @ 2018-12-16 19:47
学亮编程手记
阅读(455)
推荐(0)
摘要:
package com.zhangxueliang.udp; import java.io.IOException; import java.net.DatagramPacket; import java.net.DatagramSocket; import java.net.InetAddress; /** * 使用UDP协议发送接收数据 * @author zxlt * */ pu...
阅读全文
posted @ 2018-12-16 11:18
学亮编程手记
阅读(505)
推荐(0)
摘要:
package com.zhangxueliang.tcp; import java.io.IOException; import java.io.OutputStream; import java.net.InetAddress; import java.net.Socket; /*** * 使用tcp协议发送接收数据 * @author zxlt * */ public class...
阅读全文
posted @ 2018-12-16 11:17
学亮编程手记
阅读(651)
推荐(0)
摘要:
--检查约束 create table test1( id number(10) primary key, email varchar2(10) check (email like '%@%') ) drop table test1 insert into test1 values(1,'12@6.com'); select * from test1 create ...
阅读全文
posted @ 2018-12-09 12:11
学亮编程手记
阅读(498)
推荐(0)
摘要:
--备份表数据 select * from t_owners; --创建备份表 create table t_owners_copy ( id number, name varchar2(100), addressid number, housenumber varchar2(100), watermeter varchar2(100), adddate da...
阅读全文
posted @ 2018-12-09 11:59
学亮编程手记
阅读(304)
推荐(0)
摘要:
--INSTR函数 SELECT INSTR(' HELLO WORLD','H') FROM DUAL; --LTRIM RTRIM函数 SELECT LTRIM('*HELLO=','*') FROM DUAL; SELECT RTRIM('=HELLO=','=') FROM DUAL; SELECT RTRIM(LTRIM('*HELLO*','*'),'*') FROM DUAL; -...
阅读全文
posted @ 2018-12-08 20:06
学亮编程手记
阅读(211)
推荐(0)
摘要:
with temp as( select '湖北省' province,'武汉市' city,'第一' ranking from dual union all select '湖北省' province,'孝感市' city,'第二' ranking from dual union all select '湖北省' province,'宜昌市' city,'第三' ...
阅读全文
posted @ 2018-12-08 15:18
学亮编程手记
阅读(341)
推荐(0)
摘要:
easyUI 数据表格datagrid的使用
阅读全文
posted @ 2018-12-05 22:20
学亮编程手记
阅读(366)
推荐(0)
摘要:
package com.zhangxueliang.doudizhu; import java.util.ArrayList; import java.util.Collections; public class Doudizhu { public static void main(String[] args) { /** * 1.组装54张扑克牌 ...
阅读全文
posted @ 2018-12-04 21:48
学亮编程手记
阅读(138)
推荐(0)
摘要:
npm下载会很慢,因为npm默认从国外下载资源,建议修改npm镜像源地址 1.运行npm i nrm -g全局安装nrm包; 2.使用nrm ls查看当前所有可用的镜像源地址以及当前所使用的镜像源地址; 3.使用nrm use taobao切换镜像源地址
阅读全文
posted @ 2018-12-03 22:19
学亮编程手记
阅读(3493)
推荐(0)
摘要:
--分析函数 --rank() over(order by) --值相同,排名相同,序号跳跃 select * from t_account select rank() over(order by usenum desc) 排名,t.* from t_account t --值相同,排名相同,序号连续 select dense_rank() over(order by usenum desc) ...
阅读全文
posted @ 2018-12-03 22:04
学亮编程手记
阅读(328)
推荐(0)
摘要:
select (select name from t_area where id=areaid) 区域, sum(case when month = '01' then money else 0 end) 一月, sum(case when month = '02' then money else 0 end) 二月, sum(case when month = '...
阅读全文
posted @ 2018-11-24 20:35
学亮编程手记
阅读(805)
推荐(0)
摘要:
(1)--取系统当前日期 select sysdate from dual; (2)--加月 select add_months(sysdate,2) from dual; --减月 select add_months(sysdate,-2) from dual; (3)--求当月最后一天 select last_day(sysdate) from dual; select last_day(s...
阅读全文
posted @ 2018-11-22 22:23
学亮编程手记
阅读(159)
推荐(0)
摘要:
(1)--转换函数 --数字转换字符串 select to_char(100)||'分' from dual; select 100||'' from dual; (2)--日期转字符串 select to_char(sysdate,'yyyy-mm-dd') from dual; select to_char(sysdate,'yyyy')||'年'||to_char(sysdate,'mm'...
阅读全文
posted @ 2018-11-22 22:22
学亮编程手记
阅读(189)
推荐(0)
摘要:
--数值函数 --四舍五入 select round(100.23456789,3) from dual select round(100.5,2) from dual --数字截取 select trunc(100.23856,2) from dual --取模 select mod(10,3) from dual
阅读全文
posted @ 2018-11-22 21:55
学亮编程手记
阅读(160)
推荐(0)
摘要:
--字符函数 --伪表dual --(1)求字符串长度 select length('123.456/-*') from dual --(2)截取函数求字符串的子串 select substr('ABCDEF',2,2) from dual --(3)字符串拼接 select concat('ABC','DE') from dual select concat(concat('ABC','DE'...
阅读全文
posted @ 2018-11-22 21:38
学亮编程手记
阅读(268)
推荐(0)
摘要:
--Oracle列转行函数LISTAGG() with tb_temp as( select 'China' 国家,'Wuhan' 城市 from dual union all select 'China' 国家,'Dongjing' 城市 from dual union all select 'China' 国家,'Xijing' 城市 from dual union all ...
阅读全文
posted @ 2018-11-21 20:43
学亮编程手记
阅读(571)
推荐(0)
摘要:
--decode条件判断函数 select decode(100,150,200,300,400,-1) from dual --需求:不通过连表查询,显示业主类型名称列的值 select name,decode(ownertypeid,1,'居民',2,'事业单位',3,'商业','其他') from t_owners --case when then写法 select name,( ...
阅读全文
posted @ 2018-11-21 20:23
学亮编程手记
阅读(4587)
推荐(0)
摘要:
--NVL空值处理函数 --需求:显示价格表中业主类型ID为1的价格记录 如果上限值为null,则显示9999999 select nvl(null,0) from dual; select * from t_pricetable select nvl(maxnum,9999999) from t_pricetable where ownertypeid=1; --NVL2函数 select ...
阅读全文
posted @ 2018-11-21 20:09
学亮编程手记
阅读(505)
推荐(0)
摘要:
--内连接查询 --需求:查询显示业主编号、业主名称、业主类型名称 select os.id 业主编号,os.name 业主名称,ot.name 业主类型名称 from t_owners os,t_ownertype ot where os.ownertypeid=ot.id --需求:查询显示业主编号、业主名称、地址和业主类型 select ow.id 业主编号,ow.name 业主名称,ad...
阅读全文
posted @ 2018-11-19 22:39
学亮编程手记
阅读(196)
推荐(0)
摘要:
--带出参的存储过程的创建和调用 create or replace procedure pro_owners_add1 ( v_name varchar2,--名称 v_addressid number,--地址编号 v_housenumber varchar2,--门牌号 v_watermeter varchar2,--水表号 v_ownertypeid number,-...
阅读全文
posted @ 2018-11-16 22:13
学亮编程手记
阅读(202)
推荐(0)