Please enable JavaScript to view this site.

R:BASE 11 Help

Navigation: Command Index > S > SELECT

EXCEPT

Scroll Prev Top Next More

The EXCEPT clause allows for specified columns to be excluded from a SELECT query.

 

SELECT_EXCEPT

 

 

The EXCEPT clause is another clause you can have in a SELECT command like WHERE and ORDER BY.

 

SELECT ... EXCEPT selects data from all records in the table, except for columns in exclusion list. When using SELECT ... EXCEPT there can only be one table in the FROM clause.

 

The EXCEPT clause is helpful with tables which have many columns, to exclude columns from the result set. EXCEPT saves time to avoid typing a long list of column names in a SELECT statement.

 

Examples

 

The below selects all columns from the Customer table, except CustURL and CustEMail

SELECT ALL FROM Customer EXCEPT CustURL, CustEMail

 

The below selects all columns from the Employee table where the sales bonus are greater than $200.00

SELECT ALL FROM Employee EXCEPT HireDate, EntryDate WHERE EmpID IN (SELECT EmpID FROM SalesBonus WHERE Bonus > 200.00)