45 Very useful Oracle query statementsBin black tea Children's shoes published in 2014-1-22 13:13 4 hours ago, 38 back/3213 read, the last answer: 1 minutes ago
Here we introduce 40+ a very useful Oracle query, mainly covers the date operation, get the server information, get the execution status, calculate the database size and so on aspects of the query. These are the skills that all Oracle developers must have, so collect them quickly. Date/Time related queries
Gets the first day of the current month
Run this command to quickly return to the first day of the current month. You can replace "sysdate" with any date value to specify the date of the query.
1 |
Select TRUNC (sysdate, ' MONTH ') "the" |
get the last day of the current month
This query is similar to the above statement and takes care of the leap year, so when you have number 29th in February, you will return 29/2. You can replace "sysdate" with any date value to specify the date of the query.
1 |
Select TRUNC (Last_day (sysdate)) "Last day of the current month" |
gets the first day of the current year
The first day of the year is January 1, and this query statement can be used in a stored procedure that requires some calculation of the first day of the current year. You can replace "sysdate" with any date value to specify the date of the query.