<< < 1 2 3 4 5 6 7 8 > >>   Sort: Rank

Convert Character Strings to Numbers in Oracle
How To Convert Characters to Numbers in Oracle? You can convert characters to numbers by using the TO_NUMBER() function as shown in the following examples: SELECT TO_NUMBER('4123.4570') FROM DUAL 4123.457 SELECT TO_NUMBER(' $4,123.46','$9,999,999.99') FROM DUAL 4123.46 SELECT TO_NUMBER(' -4.12E+03')...
2020-03-25, 729👍, 0💬

Convert Numbers to Character Strings in Oracle
How To Convert Numbers to Character Strings in Oracle? You can convert numeric values to characters by using the TO_CHAR() function as shown in the following examples: SELECT TO_CHAR(4123.4570) FROM DUAL 123.457 SELECT TO_CHAR(4123.457, '$9,999,999.99') FROM DUAL $4,123.46 SELECT TO_CHAR(-4123.457, ...
2020-03-25, 704👍, 0💬

Increment Dates by 1 in Oracle
How To Increment Dates by 1 in Oracle? If you have a date, and you want to increment it by 1. You can do this by adding the date with a date interval. You can also do this by adding the number 1 directly on the date. The tutorial example below shows you how to adding numbers to dates, and take date ...
2020-03-15, 864👍, 0💬

Use of Regular Expression in Oracle
How To Use Regular Expression in Pattern Match Conditions in Oracle? If you have a pattern that is too complex for LIKE to handle, you can use the regular expression pattern patch function: REGEXP_LIKE(). The following script provides you some good examples: SELECT CASE WHEN REGEXP_LIKE ('FYICenter....
2020-03-15, 772👍, 0💬

Use IN Conditions in Oracle
How To Use IN Conditions in Oracle? An IN condition is single value again a list of values. It returns TRUE, if the specified value is in the list. Otherwise, it returns FALSE. Some examples are given in the script below: SELECT CASE WHEN 3 IN (1,2,3,5) THEN 'TRUE' ELSE 'FALSE' END FROM DUAL; TRUE S...
2020-03-15, 737👍, 0💬

Use LIKE Conditions in Oracle
How To Use LIKE Conditions in Oracle? LIKE condition is also called pattern patch. There 3 main rules on using LIKE condition: '_' is used in the pattern to match any one character. '%' is used in the pattern to match any zero or more characters. ESCAPE clause is used to provide the escape character...
2020-03-15, 712👍, 0💬

Date and Time Differences in Oracle
How To Calculate Date and Time Differences in Oracle? If you want to know how many years, months, days and seconds are there between two dates or times, you can use the date and time interval expressions: YEAR ... TO MONTH and DAY ... TO SECOND. The tutorial exercise below gives you some good exampl...
2020-03-15, 678👍, 0💬

Create a New Table with SELECT Statements in Oracle
How To Create a New Table by Selecting Rows from Another Table in Oracle? Let's say you have a table with many data rows, now you want to create a backup copy of this table of all rows or a subset of them, you can use the CREATE TABLE...AS SELECT statement to do this. Here is an example script: &...
2020-02-29, 908👍, 0💬

ALTER TABLE - Add a New Column in Oracle
How To Add a New Column to an Existing Table in Oracle? If you have an existing table with existing data rows, and want to add a new column to that table, you can use the ALTER TABLE ... ADD statement to do this. Here is an example script: SQL&gt; connect HR/fyicenter Connected. SQL&gt; CREA...
2020-02-29, 833👍, 0💬

Create a New Table in Oracle
How To Create a New Table in Oracle? If you want to create a new table in your own schema, you can log into the server with your account, and use the CREATE TABLE statement. The following script shows you how to create a table: &gt;.\bin\sqlplus /nolog SQL&gt; connect HR/fyicenter Connected....
2020-02-29, 813👍, 0💬

What Are DDL Statements in Oracle
What Are DDL Statements in Oracle? DDL (Data Definition Language) statements are statements to create and manage data objects in the database. The are 3 primary DDL statements: CREATE - Creating a new database object. ALTER - Altering the definition of an existing data object. DROP - Dropping an exi...
2020-02-29, 781👍, 0💬

Understanding SQL DDL Statements for Oracle
Where to find answers to frequently asked questions on SQL DDL Statements for Oracle? I want to start creating tables. Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on SQL DDL Statements for Oracle. Clear answers are provided with tutorial exercise...
2020-02-29, 746👍, 0💬

ALTER INDEX - Rename an Index in Oracle
How To Rename an Index in Oracle? Let's say you have an existing index, and you don't like its name anymore for some reason, you can rename it with the ALTER INDEX ... RENAME TO statement. Here is an example script on how to rename an index: CREATE TABLE student (id NUMBER(5) PRIMARY KEY, first_name...
2020-02-20, 846👍, 0💬

ALTER TABLE - Delete a Column in Oracle
How To Delete a Column in an Existing Table in Oracle? If you have an existing column in a table and you need that column any more, you can delete it with ALTER TABLE ... DROP COLUMN statement. Here is an example SQL script: SQL&gt; CREATE TABLE emp_dept_90 2 AS SELECT * FROM employees WHERE dep...
2020-02-20, 757👍, 0💬

DROP TABLE Statement in Oracle
How To Drop an Existing Table in Oracle? If you want to delete an existing table and its data rows, you can use the DROP TABLE statement as shown in this script: SQL&gt; connect HR/fyicenter Connected. SQL&gt; CREATE TABLE emp_dept_10 2 AS SELECT * FROM employees WHERE department_id=10; Tabl...
2020-02-20, 732👍, 0💬

CREATE INDEX - Create a Table Index in Oracle
How To Create a Table Index in Oracle? If you have a table with a lots of rows, and you know that one of the columns will be used often a search criteria, you can add an index for that column to in improve the search performance. To add an index, you can use the CREATE INDEX statement as shown in th...
2020-02-20, 682👍, 0💬

Drop an Existing Index in Oracle
How To Drop an Existing Index in Oracle? If you don't need an existing index any more, you should delete it with the DROP INDEX statement. Here is an example SQL script: CREATE TABLE student (id NUMBER(5) PRIMARY KEY, first_name VARCHAR(80) NOT NULL, last_name VARCHAR(80) NOT NULL, birth_date DATE N...
2020-02-20, 665👍, 0💬

Understanding SQL DML Statements for Oracle
Where to find answers to frequently asked questions on SQL DML Statements for Oracle. I want insert and delete data in tables. Here is a list of frequently asked questions and their answers compiled by FYIcenter.com DBA team on SQL DML Statements for Oracle. Clear answers are provided with tutorial ...
2020-02-07, 811👍, 0💬

What Are DML Statements in Oracle
What Are DML Statements in Oracle? DML (Data Manipulation Language) statements are statements to change data values in database tables. The are 3 primary DML statements: INSERT - Inserting new rows into database tables. UPDATE - Updating existing rows in database tables . DELETE - Deleting existing ...
2020-02-07, 729👍, 0💬

Create a Test Table for DML Testing in Oracle
How To Create a Testing Table in Oracle? If you want to practice DML statements, you should create a testing table as shown in the script below: CREATE TABLE fyi_links (id NUMBER(4) PRIMARY KEY, url VARCHAR2(80) NOT NULL, notes VARCHAR2(1024), counts NUMBER, created DATE DEFAULT (sysdate)); Table cr...
2020-02-07, 712👍, 0💬

Create a New View in Oracle
How To Create a New View in Oracle? You can create a new view based on one or more existing tables by using the CREATE VIEW statement as shown in the following script: CREATE VIEW employee_department AS SELECT e.employee_id, e.first_name, e.last_name, e.email, e.manager_id, d.department_name FROM em...
2020-02-07, 652👍, 0💬

Drop an Existing View in Oracle
How To Drop an Existing View in Oracle? If you have an existing view, and you don't want it anymore, you can delete it by using the DROP VIEW statement as shown in the following script: DROP VIEW employee_department; View dropped.   ⇒Understanding SQL DDL Statements for Oracle ⇒⇒Oracle Database Tut...
2020-02-07, 608👍, 0💬

Set Up SQL*Plus Output Format in Oracle
How To Set Up SQL*Plus Output Format in Oracle? If you want to practice SQL statements with SQL*Plus, you need to set up your SQL*Plus output formatting parameter properly. The following SQL*Plus commands shows you some examples: COLUMN id FORMAT 9999; COLUMN url FORMAT A24; COLUMN notes FORMAT A12;...
2020-01-29, 755👍, 0💬

Omit Columns in INSERT Statements in Oracle
How To Omit Columns with Default Values in INSERT Statement in Oracle? If you don't want to specify values for columns that have default values, or you want to specify values to columns in an order different than how they are defined, you can provide a column list in the INSERT statement. If a colum...
2020-01-29, 744👍, 0💬

<< < 1 2 3 4 5 6 7 8 > >>   Sort: Rank