45 Useful Oracle Queries
Here’s a list of 40+ Useful Oracle queries that every Oracle developer must bookmark. These queries range from date manipulation, getting server info, get execution status, calculate database size etc. Date / Time related queries Get the first day of the month Quickly returns the first day of current month. Instead of current month you want to find first day of month where a date falls, replace SYSDATE with any date column/value. SELECT TRUNC (SYSDATE, 'MONTH') "First day of current month" FROM DUAL; Get the last day of the month This query is similar to above but returns last day of current month. One thing worth noting is that it automatically takes care of leap year. So if you have 29 days in Feb, it will return 29/2. Also similar to above query replace SYSDATE with any other date column/value to find last day of that particular month. SELECT TRUNC (LAST_DAY (SYSDATE)) "Last day of current month" FROM DUAL; Get th...