10

Numeric Data Types

SQL is not a computational language; the arithmetic capability of SQL is weaker than that of any other high-level programming language you have ever used. But there are some tricks that you need to know working with numbers in SQL and when passing them to a host program. Much of the arithmetic and the functions are implementation-defined, so you should experiment with your particular product and make notes on the defaults, precision, and tools in the math library of your database.

This section deals with the arithmetic that you would use across a row instead of down a column; they are not quite the same.

10.1 Numeric Types

The SQL standard has a very wide range of numeric types. The idea is that any host language can find an ...

Get Joe Celko's SQL for Smarties, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.