Use GREATEST()
E.g.:
SELECT GREATEST(2,1);
Note: Whenever if any single value contains null at that time this function always returns null (Thanks to user @sanghavi7)
More Related Contents:
- Calculate Average of the largest values in multiple columns
- How can I SELECT rows with MAX(Column value), PARTITION by another column in MYSQL?
- SQL Query to get column values that correspond with MAX value of another column?
- MySQL: Select top n max values?
- How to SELECT by MAX(date)?
- Deleting a row based on the max value
- SQL select only rows with max value on a column [duplicate]
- What is the error “Every derived table must have its own alias” in MySQL?
- Generating Depth based tree from Hierarchical Data in MySQL (no CTEs)
- Authentication plugin ‘caching_sha2_password’ cannot be loaded
- How to grant remote access permissions to mysql server for user?
- mySQL convert varchar to date
- Generating a series of dates [duplicate]
- Why is the estimated rows count very different in phpmyadmin results?
- Slow query when using ORDER BY
- How to import XML file into MySQL database table using XML_LOAD(); function
- Matching all values in IN clause
- Having both a Created and Last Updated timestamp columns in MySQL 4.0
- How can I set a maximum number of rows in MySQL table?
- Which is faster — INSTR or LIKE?
- Remove duplicate rows leaving oldest row Only?
- Show constraints on tables command
- Remove special characters from a database field
- Set user variable from result of query
- Mysql command not found in OS X 10.7
- How to make a primary key start from 1000?
- The best way to remove value from SET field?
- SQL (MySQL) vs NoSQL (CouchDB) [closed]
- Select by Month of a field
- MySQL Illegal mix of collations