Search
 
SCRIPT & CODE EXAMPLE
 

SQL

if else in postgresql

DO $$
DECLARE
   a integer := 10;
   b integer := 10;
BEGIN 
  IF a > b THEN 
     RAISE NOTICE 'a is greater than b';
  ELSIF a < b THEN
     RAISE NOTICE 'a is less than b';
  ELSE
     RAISE NOTICE 'a is equal to b';
  END IF;
END $$;
Comment

if else in postgresql

DO $$
DECLARE
   a integer := 10;
   b integer := 10;
BEGIN 
  IF a > b THEN 
     RAISE NOTICE 'a is greater than b';
  ELSIF a < b THEN
     RAISE NOTICE 'a is less than b';
  ELSE
     RAISE NOTICE 'a is equal to b';
  END IF;
END $$;
Comment

PREVIOUS NEXT
Code Example
Sql :: null column as zero in mysql 
Sql :: insert into auto increment mysql 
Sql :: sql oracle update multiple rows 
Sql :: How to backup databases using psql 
Sql :: sql delete duplicate 
Sql :: mysql add columns 
Sql :: mysql default value 
Sql :: run function in sql 
Sql :: how to create a table structure from another table in mysql 
Sql :: delete from IN subquery 
Sql :: not regexp_like in oracle 
Sql :: convert columns to rows in sql server 
Sql :: postgres create database if not exists 
Sql :: postgres get number of days between two dates 
Sql :: oracle sql number to varchar2 
Sql :: ERROR 1064 (42000) 
Sql :: read xml in sql server 
Sql :: Assign value to variable inside Dynamic SQL 
Sql :: sqlite commands 
Sql :: sql join 
Sql :: difference between normalization and denormalization 
Sql :: generate sql from specific migration ef core 
Sql :: json_remove mysql 
Sql :: mysql delete from where like 
Sql :: flask connect to mysql 
Sql :: dublicate row sql 
Sql :: select other columns with distinct 
Sql :: nested select sql 
Sql :: mssql remove duplicate rows 
Sql :: difference between in and between in sql 
ADD CONTENT
Topic
Content
Source link
Name
5+3 =