Ansi SQL type casting
Asked Answered
M

1

8

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.

Melodics answered 7/10, 2009 at 7:10 Comment(0)
U
9

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

Uglify answered 7/10, 2009 at 8:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.