A concise tutorial of SQL statements for Linux---between

Source: Internet
Author: User

in this command allows us to capture the values in the database within the limits of one or several discontinuous (discrete) values, while the between allows us to use a range (range) to scratch out the values in the database. between The syntax for this clause is as follows:

Select "Field name"
From "Table name"
WHERE "field name" between ' Value one ' and ' value two ';

This will select each of the data that contains the value one and the value two for the field value.

For example, if we were to find all the data from the store_information table in January 6, 1999 and January 10, 1999,

store_information Form

Store_name Sales Txn_date
Los Angeles 1500 05-jan-1999
San Diego 250 07-jan-1999
San Francisco 300 08-jan-1999
Boston 700 08-jan-1999

We'll break in,

SELECT *
From Store_information
WHERE txn_date between ' jan-06-1999 ' and ' jan-10-1999 ';

Please note: In different databases, the method of storing dates may vary. Here we choose one of the storage methods.

Results:

Store_name Sales Txn_date
San Diego 250 07-jan-1999
San Francisco 300 08-jan-1999
Boston 700 08-jan-1999


The results of Linux testing are as follows:


Reprint please indicate the author: Xiao Liu

A concise tutorial of SQL statements for Linux---between

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.