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.

Least Function In Sql in SQL

Least Function In Sql in SQL

LEAST Function in SQL

The LEAST function returns the smallest (minimum) value from a list of expressions.


Syntax:

LEAST(value1, value2, value3, ...)
  • Compares the values and returns the smallest one.


Example:

SELECT LEAST(10, 25, 5, 30) AS smallest_value;

Result:

smallest_value
5

Notes:

  • Works with numbers, strings (alphabetical order), and dates.

  • If any value is NULL, result is NULL (in most databases).

  • Supported in MySQL, Oracle, PostgreSQL. Not supported directly in SQL Server (you can use CASE or other methods instead).


If you want examples in a specific database or more use cases, let me know!

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