Showing posts with label SQL Between Operator. Show all posts
Showing posts with label SQL Between Operator. Show all posts

Tuesday, October 6, 2020

SQL Between Operator


 

  1. SQL Between Operator:

       Syntax : Select columnname(s)  from tablename  where columnname between 

                      value1 and value 2;

        Function: The Between operator is used to fetch values from particular column 

                         in a given table based on certain values.


2. SQL Not Between operator:

     Syntax: Select columnname(s)  from tablename  where columnname Not between 

                      value1 and value 2;

    Function: The Not Between operator is used to fetch values from particular column 

                         in a given table by excluding the given values.

 

3.SQL Between with IN:

Syntax: Select columnname(s)  from tableneame  Between value1 and value2 and

              columnname NOT IN(value1,value2,value3....);   

Function: SQL Between with IN is used to fetch data from particular column 

                 of a  table according to the IN Clause.

 

4. SQL Between Text values: 

    Syntax: Select Columnname(s) from tablename between "text1" and "text2";

    Function: This query is used to fetch data from the table based on two text

                    parameters.

5.SQL NOT Between Text values: 

   Syntax: Select  columnname(s)  from tablename Not Between "text1" and

                 "text2";

  Function: This query is used to fetch details from the table about particular

                    column which are not between the given text values.


6. SQL Between   Dates:

     Syntax: Select Columnname(s)  from the tablename Between 'yyyy-mm-dd' 

                   and 'yyyy-mm-dd';

                                                             OR

       Syntax: Select Columnname(s)  from the tablename Between #yyyy-mm-dd#

                   and #yyyy-mm-dd#;

      Function: This query is used to fetch details from a particular column of 

                        a table  according to the given dates.