Deals Of The Week - hours only!Up to 80% off on all courses and bundles.-Close
Review
So you think you can count?
Rounding functions and more
20. Numeric functions: ABS()
Review and practice

Instruction

Nice!

Of course, T-SQL has also other numeric functions. Let's take a look at two of them.

The first one is ABS(x), and it returns the absolute value of x. Non-negative numbers will be expressed as they are, but negative ones will be expressed without the negative sign. Have a look:

SELECT
  ABS(3),
  ABS(-3);

The above query will return 3 twice. The absolute value of 3 is 3, and so is the absolute value of -3.

Let's give this a try in the next exercise.

Exercise

For each character, show its actual StatModifier value and StatModifier's absolute value. Name the column AbsoluteStatModifier.

Stuck? Here's a hint!

Use ABS(StatModifier).