Ansi SQL type casting

帅比萌擦擦* 提交于 2020-01-01 09:39:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!