1BETWEEN wählt Werte innerhalb eines bestimmten Bereichs aus.
2Die Werte können Zahlen, Text oder Datumsangaben sein.
3
4SELECT column_name(s)
5FROM table_name
6WHERE
7 column_name BETWEEN value1 AND value2;
8
1/*the BETWEEN operator is used to filter the result set within
2a certain range. the values can be numbers, texts or dates */
3SELECT column_name(s)
4FROM table_name
5WHERE column_name BETWEEN value1 AND value2;
1SELECT * FROM my_table WHERE my_col BETWEEN 10 AND 20;
2-- equivalent to
3SELECT * FROM my_table WHERE my_col >= 10 AND my_col <= 20;
1• BETWEEN operator is used to display
2rows based on a range of values in a
3row whereas the IN condition operator
4is used to check for values contained
5in a specific set of values.
6• Example of BETWEEN:
7SELECT * FROM Students
8WHERE ROLL_NO BETWEEN 10 AND 50;
9• Example of BETWEEN:
10SELECT * FROM students
11WHERE ROLL_NO IN (8,15,25);
1SELECT column_name(s)
2FROM table_name
3WHERE column_name BETWEEN value1 AND value2;
1(Between) operator same as ">= <="
2For example:
3Select * From Employees Where salary Between 4000 AND 6000;
4