标签:eve 数字 inf sequence connect 模糊 十分 als char
select m.org_id
from sm_organ m
start with m.org_id = '00000'
connect by prior m.org_id = m.parent_org_id; [查询org_id为‘00000’的所有父节点,并按倒叙排序]
select distinct root,root_leve,org_Id
from
(
select sys_connect_by_path (org_id, '/') as PATH,connect_by_root(org_id) as root,connect_by_root(org_leve) as root_leve,t.*
from sm_ORGAN t
start with org_leve IN ('3')
connect by NOCYCLE parent_org_id = prior org_id
) a ;
SUB.AU_OPER LIKE '%'||#auOper#||'%' AND
createDate = to_date(sysdate,'yy-MM-dd hh24:mi:ss')
或者直接比较 createDate > '2013-09-08 00:00:00'
或者 createDate = to_date('','yyyyMMdd')
或者 createDate = date'2016-09-09'
-- 将查询字段中的name名称中部分汉字转换成想要的结果
SELECT replace(
replace(
replace('xxxxxxxxxxxxxxxxxxxxx', ''|| chr(15xxxx92) || chr(1524xx81) ||chr(1xxxx521) || chr(15xxxx814) ||chr(1xxxx592) || '', ''),
''|| chr(1xxxx02) || chr(1xxxx485) || chr(149xxxx48) || chr(14xxxx6) || chr(153xxxx92) || '', ''),
''|| chr(150xxxx3) || chr(15xxxxx425) || chr(x770xxx2) ||chr(15xxxx08) || '', '') ORG_xxxx
FROM SMS_xxxxx ORG
WHERE 1 = 1
AND ORG_xxxx = '0951' ;
select ''|| chr(15252223392) ||chr(1225303592) || '' aa from dual; -- 拼接字符串
select ascii('国') aa from dual; -- 将汉字转为数字
select chr(15047613) bb from dual; --将数字转为汉字
select replace('111123224455', '22' , '44') aa from dual; --替换字符串中的字符
select asciistr('国汉字之都') aa from dual; --将一串字符串转为中文编码 \56FD\6C49\5B57\4E4B\90FD
select convert('在中国','zhs16gbk','utf8') aa from dual; --将字符串从一种字符转为另一种字符
select WM_CONCAT(us.USeER_ID) USERS from sm_euser us where us.oreg_id = '0200' ;
declare
num number;
begin
select count(1) into num from user_tables where table_name = upper('sys_area') ;
if num > 0 then
execute immediate 'drop table sys_area' ;
end if;
end;
merge into BOS_PARA_CONL_RULES a
using bos_para_codel_info b
on (a.modeel_no = b.model_no)
when MATCHED then
update
set trade_system = #tradeSystem#,
trade_name = #tradeName#,
note = #Note#,
system_basis = #systemBasis#
where b.modeel_no = #modelNo#
When not matched then
insert
(TRADE_SYSTEM,
TRADE_NAME,
NOTE,
SYSTEM_BASIS)
values
(#tradeSystem#,
#tradeName#,
#Note#,
#systemBasis#) where b.modeel_no = #modelNo#
--1
TRUNC(date[,fmt])
TRUNC(TO_DATE('24-Nov-1999 08:37 pm','dd-mon-yyyy hh:mi am'),'hh') ='24-Nov-1999 08:00:00 am'
trunc(sysdate,'yyyy') --返回当年第一天。
trunc(sysdate,'mm') --返回当月第一天。
trunc(sysdate,'d') --返回当前星期的第一天。
trunc(sysdate,'dd')--返回当前年月日
--2
TRUNC(for number)
TRUNC(number[,decimals])
其中:
number 待做截取处理的数值
decimals 指明需保留小数点后面的位数。可选项,忽略它则截去所有的小数部分
下面是该函数的使用情况:
TRUNC(89.985,2)=89.98
TRUNC(89.985)=89
TRUNC(89.985,-1)=80
--日期
1.select trunc(sysdate) from dual --2011-3-18 今天的日期为2011-3-18
2.select trunc(sysdate, 'mm') from dual --2011-3-1 返回当月第一天.
3.select trunc(sysdate,'yy') from dual --2011-1-1 返回当年第一天
4.select trunc(sysdate,'dd') from dual --2011-3-18 返回当前年月日
5.select trunc(sysdate,'yyyy') from dual --2011-1-1 返回当年第一天
6.select trunc(sysdate,'d') from dual --2011-3-13 (星期天)返回当前星期的第一天
7.select trunc(sysdate, 'hh') from dual --2011-3-18 14:00:00 当前时间为14:41
8.select trunc(sysdate, 'mi') from dual --2011-3-18 14:41:00 TRUNC()函数没有秒的精确
--数字
/*
TRUNC(number,num_digits)
Number 需要截尾取整的数字。
Num_digits 用于指定取整精度的数字。Num_digits 的默认值为 0。
TRUNC()函数截取时不进行四舍五入
*/
9. select trunc(123.458) from dual --123
10.select trunc(123.458,0) from dual --123
11.select trunc(123.458,1) from dual --123.4
12.select trunc(123.458,-1) from dual --120
13.select trunc(123.458,-4) from dual --0
14.select trunc(123.458,4) from dual --123.458
15.select trunc(123) from dual --123
16.select trunc(123,1) from dual --123
17.select trunc(123,-1) from dual --120
create sequence SEQ_xxOS_AUxxxED_FB_ID
minvalue 1
maxvalue 99999999999999999999
start with 669408473
increment by 1
cache 20
cycle;
--SEQUENCE
GRANT SELECT, ALTER ON SEQ_xxOS_AUxxxED_FB_IDxxOxxxETL;
GRANT SELECT, ALTER ON SEQ_xxOS_AUxxxED_FB_IDxxxxxR;
--SEQUENCE SYNONYM
CREATE OR REPLACE PUBLIC SYNONYM SEQ_xxOS_AUxxxED_FB_IDFOR sxxS.SEQ_xxOS_AUxxxED_FB_ID;
select * from xx_mxenu; //菜单表
select * from xx_UxER; //用户表
select * from xx_SSxTEM_ROxLE; //角色表
select * from xx_USxER_ROxLE; //用户角色表
select * from xxEF_RxLE_MExNU; //角色菜单表
select * from bos_comm_field f where f.field_name='GET_CHECK_TYPE';
select * from bos_comm_code C WHERE C.CODE_TYPE='CHECK_TYPE' ;
10.10.10.100 = (DESCRIPTION =(ADDRESS=(PROTOCOL=TCP) (HOST = 10.10.10.100) (PORT=1234))(CONNECT_DATA=(SID=oredd)))
xxx/123456
--SYNONYM
CREATE OR REPLACE PUBLIC SYNONYM xxxxxx表名 FOR 库名.xxxxxx表名;
-- GRANT/REVOKE OBJECT PRIVILEGES
GRANT SELECT, INSERT, UPDATE, DELETE ON xxxxxx表名 TO 用户名;
select to_char(sysdate, 'yyyymmdd')||lpad(seq_xxxxxtem_id.nextval,15, '0') from dual;
EXECUTE IMMEDIATE 'TRUNCATE TABLE TEMP_ITEM_ACC';
未完后续补充中。。。。。。。。。。
标签:eve 数字 inf sequence connect 模糊 十分 als char
原文地址:https://www.cnblogs.com/eian/p/11478491.html