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


Misc Oracle SQL SELECT Examples

SELECT - All columns

Return all columns.

SELECT 
   *  
FROM COURSES

SELECT - Return first 10 rows

Run a SQL Select statement and limit the number of rows returned. Useful when you are not sure of how to limit the recordset to be returned and you only want to return a few rows to do some initial analysis.

SELECT 
  COURSE_DESIGNATER , 
  COURSE_NAME       , 
  EMPLOYEE_INACTIVATING 
FROM COURSES
WHERE RowNum < 11 

SELECT - Count rows in table

Returns a count of the total number of rows in a table.

SELECT COUNT(*) from COURSES

SELECT - Joining tables

Join two Oracle tables together.

SELECT  
       b.COURSE_NAME        ,
       a.CLASS_END_DATE     , 
       a.CLASS_START_DATE                         
 
FROM         CLASSES a 
        JOIN COURSES b 
             ON  b.COURSE_DESIGNATER = a.COURSE_DESIGNATER_FK
WHERE  RowNum < 100 
/ 

 

 



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