Search
 
SCRIPT & CODE EXAMPLE
 

SQL

if else sql

IF Boolean_expression
BEGIN
    -- Statement block executes when the Boolean expression is TRUE
END
ELSE
BEGIN
    -- Statement block executes when the Boolean expression is FALSE
END
Comment

sql if else

DECLARE 
        a Number := 30;       b Number; 
BEGIN 
        IF a > 40 THEN 
          b := a - 40; 
          DBMS_OUTPUT.PUT_LINE('b=' || b); 
       elseif a = 30 then 
          b := a + 40; 
          DBMS_OUTPUT.PUT_LINE('b=' || b); 
       ELSE 
          b := 0; 
          DBMS_OUTPUT.PUT_LINE('b=' || b); 
       END IF; 
END; 
/
Comment

else if sql

UPDATE table 
SET columnB = CASE fieldA 
        WHEN columnA=1 THEN 'x' 
        WHEN columnA=2 THEN 'y' 
        ELSE 'z' 
      END 
WHERE columnC = 1
Comment

t-sql if else

IF 1=1
	SELECT 1
ELSE
	SELECT 0
-- returns 1

-- Definition
IF Boolean_expression   
     { sql_statement | statement_block }   
[ ELSE   
     { sql_statement | statement_block } ]
Comment

PREVIOUS NEXT
Code Example
Sql :: get month sql 
Sql :: wamp server mysql password 
Sql :: date format in oracle 
Sql :: sql select on string 
Sql :: mysql sql.gz 
Sql :: sql create cluster index 
Sql :: first max salary in sql 
Sql :: changing name of column and datatype in sql 
Sql :: carbon mysql d m y to y-m-d 
Sql :: change sql global mode 
Sql :: como hacer un select entre fechas mysql 
Sql :: sql foreign key constraint 
Sql :: md5 encode oracle 
Sql :: oracle uptime 
Sql :: round border button tkinter 
Sql :: remove decimal in sql server 
Sql :: select all from table left join 
Sql :: mysql update multiple columns 
Sql :: creating tables in sql with python 
Sql :: sql union 
Sql :: how to connect sqlalchemy to mysql and deploy it 
Sql :: mysql group rows with same value 
Sql :: order by in codeigniter query builder 
Sql :: SQL Comments Within Statements 
Sql :: IntegrityError at duplicate key value violates unique constraint DETAIL: Key id already exists. 
Sql :: oracle swap partition 
Sql :: windows could not start the sql server on local computer 
Sql :: disable database droping sql 
Sql :: sql not operator 
Sql :: drop constraint in ms sql 
ADD CONTENT
Topic
Content
Source link
Name
3+6 =