SQL ABS or ABSVAL scalar function in DB2 for i SQL

SQL ABS or ABSVAL scalar function in DB2 for i SQL
SQL ABS or ABSVAL scalar function in DB2 for i SQL, ABS, ABSVAL, SQL, sql tutorial, SQL function, sql scalar function, sql built-in function, db2 for i sql, ibmi db2
SQL ABS or ABSVAL scalar function in DB2 for i SQL

ABS or ABSVAL

The ABS or ABSVAL function returns the absolute value of a number.

ABS(Numeric Expression)

Or

ABSVAL(Numeric Expression)

Example#1 using ABS/ABSVAL built-in scalar function

select abs(-10) from sysibm.sysdummy1

Or

select absval(-10) from sysibm.sysdummy1

Output

 ABS ( - 10 ) 
           10 

Example#2 using ABS/ABSVAL built-in scalar function

select abs(1) from sysibm.sysdummy1

Or

select absval(1) from sysibm.sysdummy1

Output

 ABS ( 1 ) 
           1	 

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain