Lower, upper and initcap are case-conversion functions. If you want to change string, you can use this functions. Lower : Converts alpha character values to lowercase. Upper : Converts alpha character values to uppercase. Inıtcap : Converts alpha character values to uppercase for the first letter of each word, all other letters in lowercase. Example…
Category: Oracle
Nested Subquery in Oracle
Example select department_id, (select first_name from employees where employee_id=10) as “First Name”, (select last_name from employees where employee_id=20) as “Last Name”, (select department_name from departments where department_id = 20) as “Department” from employees where department_id = 20;
Date Functions in Oracle
Oracle default date format DD-MON-RR (14-MAY-11) for English Language Database. DD/MM/YYYY(14/05/2011) for Turkish. You can only subtraction between two dates. The result is day count. ROUND and TRUNC for Date ROUND with ‘MONTH’ => If the day is 16 or more than 16, the date rolls next month and the day makes 1. ROUND with…
Sysdate in Oracle
Sysdate very important date expression in Oracle. It is very useful date format. Sysdate gives current date. Example select sysdate from dual; Sysdate Functions Sysdate + 1 =>1 day add Sysdate – 1 =>1 day decrease Sysdate + 1/24 =>1 hour add Sysdate + 1/1440 =>1 minute add Current Date : 15-JUN-10 select sysdate+2 from…
External value in SQL
If you want to use external value in SQL, you must use && or & expressions. You can use external value in column name, table name or variable. Example select * from employees where employee_id = &employeeid; If you use to double expression (&&), this value makes a cache. You can use this cached value…