Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Get Minimum from multiple columns sql

SELECT ID, Col1, Col2, Col3, 
    (SELECT MIN(Col) FROM (VALUES (Col1), (Col2), (Col3)) AS X(Col)) AS TheMin
FROM Table
Comment

PREVIOUS NEXT
Code Example
Sql :: find duplicate keys in mysql 
Sql :: mysql first day of month date 
Sql :: restore postgres database from dump 
Sql :: how to fetch first 5 characters in sql 
Sql :: sql where max date 
Sql :: show tables in cassandra cql 
Sql :: temp table sql 
Sql :: Add SuperUser MySQL 
Sql :: duplicate table sql 
Sql :: oracle replace 
Sql :: oracle trigger after logon on database 
Sql :: find a column in all tables mysql 
Sql :: SQL Remove Index From Tables 
Sql :: sql server update to null 
Sql :: sql count distinct group by 
Sql :: trouver doublons sql 
Sql :: add column if not exists mysql 
Sql :: sql upsert 
Sql :: rename field name in mysql 
Sql :: multiple count in sql 
Sql :: run sql file in terminal 
Sql :: postgresql update auto_increment value 
Sql :: drop multiple columns in sql 
Sql :: oracle remove line breaks 
Sql :: create temporal table in sql 
Sql :: SQLSTATE[42000]: Syntax error or access violation: 1075 Incorrect table definition; there can be only one auto column and it must be defined as a key" 
Sql :: drop temp table if exists 
Sql :: remove space in sql server 2012 
Sql :: in mysql workbench contnent not feching 
Sql :: psql select database 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =