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
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/*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 column_name(s)
2FROM table_name
3WHERE column_name BETWEEN value1 AND value2;
1#The BETWEEN operator selects a range of data between two values. The values can be numbers,
2#text, or dates.
3syntax->SELECT column_name(s)
4FROM table_name
5WHERE column_name
6BETWEEN value1 AND value2
7///example///
8SELECT * FROM Persons
9WHERE LastName
10BETWEEN 'Hansen' AND 'Pettersen'
1Selects values within the given range.
2Example 1: Selects stock with a quantity between 100 and 150.
3SELECT * FROM stock
4WHERE quantity BETWEEN 100 AND 150;
5Example 2: Selects stock with a quantity NOT between 100 and 150.
6Alternatively, using the NOT keyword here reverses the logic and selects
7values outside the given range.
8SELECT * FROM stock
9WHERE quantity NOT BETWEEN 100 AND 150;