Mikhail.Mamaev
Mikhail.Mamaev

Reputation: 8039

Ansi SQL type casting

Is it allowed to cast types in ANSI SQL like in postgres for example:

SELECT SUM( CAST(qnty AS int) - CAST(reserve AS int) )  AS sum
...

qnty and reserve are character columns.

Upvotes: 8

Views: 16117

Answers (1)

Lukáš Lalinský
Lukáš Lalinský

Reputation: 41306

The CAST expression was added in SQL-92. You can see it for example in this draft.

Upvotes: 9

Related Questions