HPlogo ALLBASE/SQL Reference Manual: HP 9000 Computer Systems

Chapter 9 Search Conditions

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

This chapter discusses search condition clauses and the predicates used in them. The following sections are presented:

  • Search Condition

  • BETWEEN Predicate

  • Comparison Predicate

  • EXISTS Predicate

  • IN Predicate

  • LIKE Predicate

  • NULL Predicate

  • Quantified Predicate

A search condition specifies criteria for choosing rows to select, update, delete, insert, permit in a table, or fire rules on. Search conditions are parameters in the following statements:

  • In the SELECT statement, search conditions are used for two purposes as follows:

    • In the WHERE clause, to determine rows to retrieve for further processing. The only expressions not valid in this clause are aggregate functions and expressions containing LONG columns that are not in long column functions.

    • In the HAVING clause, to specify a test to apply to each group of rows surviving the GROUP BY clause test(s). If a GROUP BY clause is not used, the test is applied to all the rows meeting the WHERE clause conditions. References in a HAVING clause to non-grouping columns must be from within aggregate functions. Grouping columns can be referred to by name or with an aggregate function.

  • In the UPDATE statement, search conditions in the WHERE clause identify rows that qualify for updating.

  • In the DELETE statement, search conditions in the WHERE clause identify rows that qualify for deletion.

  • In the INSERT statement, search conditions in the embedded SELECT statement identify rows to copy from one or more tables or views into a table.

  • In the DECLARE CURSOR statement, search conditions in the embedded SELECT statement identify rows and columns to be processed with a cursor.

  • In the CREATE VIEW statement, search conditions in the embedded SELECT statement identify rows and columns that qualify for the view.

  • In table CHECK constraints, the search condition identifies valid rows that a table may contain.

  • In rule firing conditions, search conditions identify conditions that cause rules to fire.

Feedback to webmaster