DISC

Contents | What's New | Quick Links

 

SQL Reference - SELECT Statement Syntax

Introduction

Software Installation

Concepts and Design

Designing Applications

Omnidex Environments

SQL Reference

Omnidex API's

Utilities

Interfaces

Performance Guide

Troubleshooting Guide

Appendix

 

 

FROM Clause

 

Single Table

Multiple Tables (Joins)

Join columns must have matching datatypes and lengths

Inner Joins - Join occurs in the where clause

Outer Joins - Left Outer Join, Right Outer Join

Nested Selects

 

 

 

Single Table

SELECT * FROM CUSTOMERS

SELECT Statement Syntax

Select List Items

FROM Clause

WHERE Criteria

GROUP BY Clause

ORDER BY Clause

Criteria Conditioning

 

SQL Language Reference

ON CURSOR | INSTANCE

WITH Options

Commands

Functions

Multiple Tables (Joins)

Join columns must have matching datatypes and lengths.

SELECT company, order_number FROM CUSTOMERS, ORDERS ...

 

 

Inner Joins

Tables are joined in the WHERE clause. The join predicate is 'AND'd to other WHERE criteria predicates.

SELECT company, order_number, status FROM customers, orders WHERE
customers.customer_no = orders.customer_no AND orders.status='CANCELED'

 

 

Outer Joins

Outer joins prevent the exclusion of records in one table that do not have records in the joined table.

SELECT company, order_number, status FROM customers c LEFT JOIN orders o ON
c.customer_no = o.customer_no

SELECT company, order_number, status FROM customers c LEFT OUTER JOIN
orders o ON c.customer_no = o.customer_no

 

SELECT company, order_number, status FROM customers c RIGHT JOIN orders o ON
c.customer_no = o.customer_no

SELECT company, order_number, status FROM customers c RIGHT OUTER JOIN
orders o ON c.customer_no = o.customer_no

 

Nested Selects

select company, contact, state from customers c,
(select distinct customer_no from orders where status='back') AS o
where c.customer_no = o.customer_no and state!='co'

top

Dynamic Information Systems Corporation - Omnidex Version 3.8 Build 6 J15.03-Copyright © 2003

DISC | Documentation Home