Oracle self-Summary

Source: Internet
Author: User

(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 ', ''),''));

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.