1. We have moved to a new forum! There may be a few things not working properly so please let us know if you find a bug. Remember to use the bbCode [ sql ] tag for SQL statements.

How do I ensure that a field in a table must contain values within a specific range?

Discussion in 'SQL - Questions and Answers' started by irfanhab, May 24, 2006.

  1. irfanhab New Member

    Dialect: SQL 92
    Consider a situation where there is a "salary" field and you want to make sure that the contents of this field must be between 5,000 to 120,000.
  2. irfanhab New Member

    Dialect: Oracle
    Say your table is called "Employee"
    SQL:

    alter table Employee add check (salary between 5000 and 120000);

Share This Page