SQL between and Range Operations

Source: Internet
Author: User

SQL between and Range Operations

You can define between keywords in various forms of predicates. If the column value in a row belongs to this range, the predicate is true, which is described in the result table. The test range is between two keywords AND. It must provide the upper and lower range values. The first value must be the lower limit and the second value.

The syntax for this clause is as follows:

SELECT column_name
FROM derived_table
WHERE column_name [NOT] BETWEEN 'value1' AND 'value2'

This will retrieve the columns of all rows with 'value 1' and 'value '. Clauses can be used in any valid SQL statement-select, insert, update, or delete. It is important to note that it can treat different database tutorials differently.

Instance 1

SELECT EmployeeIDNo, Salary
FROM EmployeeStatisticsTable
WHERE salesary BETWEEN 30000 AND 50000

Instance 2

SELECT EmployeeIDNo, Salary
FROM EmployeeStatisticsTable
WHERE salesary not between 30000 AND 50000

Instance 3

SELECT *
FROM EmployeeAddressTable
WHERE LastName BETWEEN 'ackerman' AND 'Scott'

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.