Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT

Features
      Knowledge Base
      Tutorials

Partners
     ZVON.ORG
     XML
     Planet Source Code
     VisualBuilder
     Web Design
     Your HTML Source
     XML/XSLT Forums
     ASPAlliance
     Scripts
     
     Programmers Heaven
     Tek-Tips Forums
     Developer Fusion
     Code Project










CLAUSE:  WHERE

DELETE [table | *] FROM table WHERE selectcriteria

SELECT table | * FROM table WHERE selectcriteria

UPDATE table SET newvalue WHERE selectcriteria

 
The WHERE clause is used with the DELETE, SELECT, and UPDATE statements to specify a selection criteria.
 
However, the WHERE clause is optional. Consider the following SELECT example which does not use a WHERE. This simple query will return all rows from the table SongWriters:
 
SELECT * FROM SongWriters;
 
The addition of a WHERE to the previous example allows you to efficiently narrow the values that will be selected. In this example, we narrow the criteria to only 'Jazz':
 
SELECT * FROM SongWriters WHERE MusicType='Jazz';
 
By using the AND logical operator we can further narrow the criteria:
 
SELECT * FROM SongWriters WHERE MusicType='Jazz' AND YearWritten=1940;
 
You can also use the OR logical operator:
 
SELECT * FROM SongWriters WHERE MusicType='Jazz' OR MusicType='Blues';
 
Within a WHERE clause, you can link up to a total of forty (40) expressions using logicical operators:
 
SELECT * FROM SongWriters WHERE MusicType='Jazz' OR MusicType='Blues' OR MusicType='Gospel' AND YearWritten>1939 AND YearWritten<1946;


 


Copyright 1999-2005 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information