Oracle Database SQL operations

Source: Internet
Author: User

SQL statement for time field query:

Select * From mycontent t where T. create_date <= to_date ('2017-06-21 ', 'yyyy-mm-dd ')

SQL statement for modifying the time field:

Update mycontent t
Set T. create_date = to_date ('2017. 2012 13:10:45 ',
'Yyyy-mm-dd hh24: MI: ss '),
T. modify_date = to_date ('2017. 2012 13:10:45 ',
'Yyyy-mm-dd hh24: MI: ss ')
Where T. content_id = '20140901'

Statement for querying the lock table:

Select sess. Sid,
Sess. Serial #,
Lo. oracle_username,
Lo. OS _user_name,
AO. object_name,
Lo. locked_mode
From v $ locked_object Lo, dba_objects AO, V $ session sess
Where ao. object_id = Lo. object_id
And lo. session_id = sess. Sid;

Query Result string addition:

Select * 'HTTP: // www.baidu.com/index.jsp? Contentid = '| T. content_id as mylink
From mycontent t

Recursive query display:

Select Replace (replace (category_code,
'1 ',
'0 '),
'2 ',
'0 '),
'3 ',
'0 '),
'4 ',
'0 '),
'5 ',
'0 '),
'6 ',
'0 '),
'7 ',
'0 '),
'8 ',
'0 '),
'9 ',
'0') | C. category_name,
C. category_code
From mycategory C
Where C. category_code like '20140901'
Order by C. category_code

Related Article

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.