MACROMEDIA COLDFUSION MX 61-CFML Informations techniques Page 35

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 152
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 34
About SQL 35
Using the SQL WHERE clause to limit the rows returned
To conditionally select data from a table, you can add a WHERE clause to the SELECT
statement, which results in the following syntax:
SELECT column_name FROM table_name WHERE column condition value
With the WHERE clause, you can use any of the following operators:
For example, to select the columns named LastName and FirstName for Clients whose City is
Boston, use the following SELECT statement:
SELECT LastName, FirstName FROM Clients Where City = 'Boston'
The result of the preceding SQL statement contains the following data:
You can compose a WHERE clause with one or more conditions; these are called subclauses. You
join subclauses using the operators AND and OR. The AND operator displays a row if all
conditions that are listed are True. The OR operator displays a row if any of the conditions listed
are True. The following statement shows an example of a WHERE clause with multiple
subclauses:
SELECT LastName, FirstName FROM Clients Where City = 'Boston' AND FirstName =
'Marie'
Operator Description
=Equal
<> Not equal
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
BETWEEN Between an inclusive range
AND Joins one or more conditions
OR Joins one or more conditions
LIKE Specifies a search for a pattern in a column. You can use a percent sign
(%) to define wildcards (missing letters in the pattern) before and after the
pattern.
LastName FirstName
Brown Marie
Adams Russell
Vue de la page 34
1 2 ... 30 31 32 33 34 35 36 37 38 39 40 ... 151 152

Commentaires sur ces manuels

Pas de commentaire