I need a way to determine the n开发者_StackOverflow中文版umber of days between two dates in SQL.
I\'m trying to convert some Oracle SQL queries to work with (in theory) any SQL database. Some of the queries are hierarchical in nature and are written using CONNECT BY.
Is it allowed to cast types in ANSI SQL like in postgres fo开发者_开发百科r example: SELECT SUM( CAST(qnty AS int) - CAST(reserve AS int) )AS sum