A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z  special characters  sybase-tech-blog


Category: ASE: Operators: Numeric Operators

Numeric Operators

A numeric operator is part of a query, i.e. an enquiry on a database. The numeric operator is responsible for the partial stages of the query on columns of a table defined by exact numeric datatypes and decimal datatypes.

The numeric operators available for querying numeric datatypes are "+" (plus), "-" (minus), "*" (asterisk) and "/" (slash or solidus). Besides these operators, there is also the operator "%" (modulo), which can only be used for queries on tinyint, smallint and int datatypes.

In addition, it is also possible to display operations on numeric datatypes using mathematical functions.

Numeric Operators and Examples

  • + (plus - adds column a to column b)
    select a + b from your_table

  • - (minus - subtracts column a from column b)
    select a - b from your_table

  • * (asterisk - multiplies column a and column b)
    select a * b from your_table

  • / (slash or solidus - devides column a by column b)
    select a / b from your_table

  • % (modulo - returns the modulo, i.e. the salvage value of an integer division of column a by column b. For example: Modulo of 5 / 2 = 1)
    select a % b from your_table