Tag Archive | "NATURAL JOINS ORACLE"

Tags: , , , , ,

Tips for the Oracle DBA certificatin Exam 1Z0-007

Posted on 28 May 2008 by Praveen

Be prepared to identify the correct usage the optional ESCAPE parameter when you want Oracle to interpret literally a wildcard character within the expression. In the expression, specify the escape character (for example, \) followed by the wildcard character that you want Oracle to interpret literally. Then specify the escape character in the ESCAPE parameter itself. For example, the following query returns the job IDs and job titles for jobs that have a job ID that begins with the characters “FI_”.

SELECT job_id, job_title
FROM jobs
WHERE job_id LIKE ‘FI\_%’ ESCAPE ‘\’;

The following example explains how to use the ROUND and TRUNC functions to round or truncate DATE values to the nearest day. Notice that the ROUND and TRUNC functions accept a format model element (for example, DAY) as their second argument; if you omit this argument, these functions round and truncate dates to the nearest day, respectively. Note that you can use the SQL functions ROUND and TRUNC with DATE values only; you cannot use these functions with TIMESTAMP, TSTZ, or TSLTZ values.

SELECT
ROUND(TO_DATE(’23-AUG-99:12:12′,’DD-MON-RR:HH24:MI’), ‘DAY’) AS result,
TRUNC(TO_DATE(’23-AUG-99:12:12′,’DD-MON-RR:HH24:MI’), ‘DAY’) AS result
FROM dual;

The only valid logical operators in an outer join condition are = and AND.

Continue Reading

Comments (0)







Page 1 of 11