01/18/10
The syntax for the case statement is:
Expression is optional. It is the value that you are comparing to the list of conditions. (ie: condition_1, condition_2, ... condition_n) Condition_1 to Condition_n must all be the same datatype. Conditions are evaluated in the order listed. Once a condition is found to be true, Result_1 to Result_n must all be the same datatype. This is the value returned once a condition is found to be true. Source: http://www.techonthenet.com/oracle/functions/case.php The decode function provides an IF-THEN-ELSE condition. decode( Value1, Value2 , result [, value2, result]... [, default] ) Note: If default is not provided, the decode statement will return null (if no matches are found). 01/09/10
SYSDATE The oracle sysdate function returns the current date/time. ADD_MONTHS Returns a date plus n months. Example: Returns the greatest value in a list of expressions. Example: Greatest(12, 50, 3) would return 50
Returns the smallest value in a list of expressions.
Returns the last day of the month based on a date value. Last_day(to_date('2009/11/09', 'yyyy/mm/dd')) would return Nov 30, 2009
Returns the number of months between date1 and date2.
Returns a number rounded to a certain number of decimal places. Example:
TRUNC Returns a date truncated to a specific unit of measure. 01/02/10
05:19:48 am, by moderator_damian Categories: Oracle FAQs, Oracle General, Interview Questions Finding grants on the objects:
Fire the below query on user_tab_privs table to find the grants and their details.
SELECT * FROM user_tab_privs; How to find the Oracle version of a particular database? Use of either of these queries below: select * from v$version Tag cloud«all_source table»,«alter data type of column having data»,«ascii for newline and tab»,«b-tree indexes»,«bitmap indexes»,«bulk collect»,cardinality,«column constraints»,«constraints on a table»,«control files»,cube,«ddl commands inside pl/sql proc»,«debugging a procedure»,«delete duplicates»,«describing a package body in sql plus»,«duplicate records»,«dynamic table creation in stored procedure»,«export saved database connections in toad»,«grants of an object»,«mutliline data in oracle»,«number of columns in a table»,«oracle aggregate functions»,«oracle data loader»,«oracle product version»,«oracle version»,«pragma autonomous_transaction»,rollup,«source code of a package»,«special characters in varchar2 column»,sql*loader,«toad database connections file»,user_tab_columns,user_tab_privs |