Search
 
SCRIPT & CODE EXAMPLE
 

SQL

nested if in mysql

SELECT CASE col1
	WHEN 'agree' THEN 'Ok'
    ELSE
        CASE 
            WHEN col2 >= 1 THEN 'Ko'
            ELSE 'Maybe'
        END
END AS my_result
FROM table_name;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql server rtrim everything after character 
Sql :: store select query result in variable sql server 
Sql :: restart sql server command line linux 
Sql :: sql only five first row 
Sql :: mysql command not working in linux 
Sql :: condition in count sql 
Sql :: check duplicate values plsql 
Sql :: oracle select first row order by 
Sql :: select where duplicate mysql 
Sql :: mysql update join 
Sql :: mysql disable query caching 
Sql :: wildcard in sql 
Sql :: default constraint in ms sql 
Sql :: SQL DEFAULT Constraint With Alter Table 
Sql :: mysql record group by created date count 
Sql :: SQL Server lock table example 
Sql :: oracle list grants on package 
Sql :: how to extract only year and month from date in sql 
Sql :: sql list dates between two dates 
Sql :: difference between primary key and unique key 
Sql :: mysql if null 
Sql :: mariadb json_extract 
Sql :: sql update insert and delete 
Sql :: mysql get first n characters of string 
Sql :: Get first name and last name from full name string in SQL 
Sql :: distinct sql 
Sql :: delete db postgres 
Sql :: if column value is null then in mysql 
Sql :: Cannot insert explicit value for identity column in table when IDENTITY_INSERT is set to OFF 
Sql :: get the location of where postgres database is stored 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =