codegurukool.com · Free coding tutorials & online compiler

Home › SQL Tutorial › SQL IN and BETWEEN

SQL IN and BETWEEN

Match a list or a range.

IN is a short way to write many OR tests. BETWEEN a AND b includes both ends of the range.

Example code

SELECT name FROM Customers
WHERE country IN ('UK', 'India');

SELECT id, amount FROM Orders
WHERE amount BETWEEN 25 AND 60;

Run this code in the online editor

← SQL LIKE and wildcardsSQL aliases →