问题
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.
回答1:
The CAST
expression was added in SQL-92. You can see it for example in this draft.
来源:https://stackoverflow.com/questions/1530003/ansi-sql-type-casting