mysql - How to define a date interval in a compatible way? -
I am trying to create SQL query, which is both on HSQL V2 .2.4) and MySQL (v5.1.36) server (if this can also run on DB2V9, this would be a wonderful bonus!) is the query: (here The problem is that MySQL gives the difference between the date while HSQL returns Additionally HSQL supports this syntax (but not MySQL): While MySQL does not do I have information in MySQL Let me, but as I said the solution should be interoperated. HSQLda also supports it: and or In addition to version 2.2.6, HSQLDB supports
Select the document count (*), where current_data - cast (date indexed as date) & lt; =?
current_date is a standard HSQL / MySQL function and
indexing_date is a column type
datetime Parameter
? is replaced by integer
20 ).
Select the
count (*) from the document where the date (indexing_date as date) is current_data - between 20 days and the current date
(*) Where current_data - cast (indexing_date as date) & lt; Select cast (*) from = cast (in the form of interval day)
document where the date (date format) between the current date In index date) - '20' day and current_data
select count (*) from document where indexing_date & gt; = Current_date - Interval '20' day
DATEDIFF (Datewalla, DebVilube) , which is two Returns the number of days between dates, as well as
day (datewise) , which gives the number of days since the era.
Comments
Post a Comment