MySQL BETWEEN & Alias

MySQL CASE

To specify a range of test you can use BETWEEN operator.

Example of BETWEEN:

SELECT * FROM users WHERE age BETWEEN 18 AND 55;

Here below 18 and above 55 aged user will be eliminated.

For your own understand you can give an alias name to a column while getting the data from a table. This is called alias.

SELECT first_name AS `name` FROM users WHERE age BETWEEN 18 AND 55;

For any types of queries, you can contact us on info@namasteui.com.

You may like:  Listing stored procedures in MySQL

Leave a Reply

Your email address will not be published. Required fields are marked *