Contents IndexSelecting columns from a table Comparing dates in queries

User's Guide
   Part II. Tutorials
     Chapter 7. Selecting Data from Database Tables
      Selecting rows from a table

Sometimes you will not want to see information on all the employees in the employee table. Adding a WHERE clause to the SELECT statement allows only some rows to be selected from a table.

For example, suppose you would like to look at the employees with first name John.

List all employees named John:

emp_id manager_id emp_fname emp_lname dept_id
318 1576 John Crow 400
862 501 John Sheffield 100
1483 1293 John Letiecq 300

Apostrophes and case-sensitivity

Again, you can combine what you have learned:

     SELECT emp_fname, emp_lname, birth_date
     FROM employee
     WHERE emp_fname = 'John'
     ORDER BY birth_date

Notes

Contents IndexSelecting columns from a table Comparing dates in queries