(1) Oracle obtains multiple values for joining
Wmsys. wm_concat (U. user_name) as servernames
Eg:
Select T. d_no, wmsys. wm_concat (T. Request) Request from aisuser. opr_request_do t where T. request_stage =: requeststage group by T. d_no
(2) Oracle Conditions
-- This is equivalent to not adding a condition (sometimes a column has a null value)
Select * From opr_kpi_count_report t where nvl (T. operate_type, '1') = nvl (null, nvl (T. operate_type, '1 '))
-- This is equivalent to a set with null query and is null.
And nvl (T. operate_type, '1') = nvl (operatetype, '1 ')
(3) Oracle long and date
Select to_char (to_date ('1970-01-01 00:00:00 ', 'yyyy-mm-dd hh24: MI: ss') + 1970/1324431300000/1000/60 ), 'yyyy-mm-dd hh24: MI: ss ')
Convert the current time to long:
Select sysdate,
(Sysdate-to_date ('1970-01-01 ', 'yyyy-mm-dd') * 24*60*60*1970
Current_milli from dual;
-- Get the current time zone
Select to_number (substr (tz_offset (sessiontimezone), 1, 3) from dual;
(4) Oracle cargo numbers and characters
-- Get characters
Select trim (translate (upper ('1dd231232 Xiaoming 1321asdf '), 'M', ''), '123','') from dual;
-- Get a number
Trim (translate (upper (context), 'M', ''), translate (upper (context), 'M',''), '123 ', ''),''));