SQL Server Information and Resources Bookmark this page

SQLINFO.net is a Community Service from DataExpressions makers of dbOrchestra©

Google
 

 

 

 


Oracle Code Examples

SQL DML

String Functions

Stored Procedures

SQL Views

SQL Table Basics


Using the SUBSTR() Oracle Function

Using SUBSTRING() in the SELECT clause

The SUBSTR() function is used to extract a character string from a given starting position for a given length. 

SELECT  
        SUBSTR(COURSE_DESIGNATER,6,3) as "Course number"                   
FROM    COURSES
WHERE   COURSE_DESIGNATER LIKE 'Excel%'     

Format a column using SUBSTR() and LOWER() and UPPER() functions

It is possible to use the Oracle LOWER() and UPPER() functions in conjunction with the SUBSTR() function to accomplish different types of formatting.

SELECT 
  UPPER(SUBSTR(lastname,1,1)) || LOWER(SUBSTR(lastname,2,29)) AS "Lastname"
FROM Students  

 



Copyright 2006-2007 by DataExpressions --- All Rights Reserved            dbOrchestra - Oracle home page