Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Select Min in SQL

Select Min in SQL

? SELECT MIN() in SQL

The MIN() function returns the minimum value from a column in a table. It is used to find the smallest numeric value, earliest date, or minimum string in a dataset.


? Syntax:

SELECT MIN(column_name) FROM table_name WHERE condition;

? Examples:

Find the lowest salary in employees table:

SELECT MIN(salary) AS lowest_salary FROM employees;

Find the earliest order date:

SELECT MIN(order_date) AS first_order_date FROM orders;

Find the minimum product price in a category:

SELECT MIN(price) AS min_price FROM products WHERE category = 'Electronics';

? Notes:

  • Works on numeric, date/time, and string columns.

  • Returns a single scalar value.

  • Can be used with GROUP BY to find minimums per group:

SELECT department, MIN(salary) AS min_salaryFROM employeesGROUP BY department;

Want examples combining MIN() with other functions or clauses?

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql