One: Connectors in individual data
Connector for SQL Server: + (plus)
SQLite's connector:. (dot)
Connector for PostgreSQL: | | Or
Two:
Today, when PostgreSQL calculates the date, I turn over some information, rarely, record it!
The functions and variables used in these
To_char (), Date (), now (), current_date
Calculates the difference of two dates
Current_date is today's date, as: 2015-06-03
Date (' 2015-06-05 ')-current_date=2
Select To_char (current_date, ' yyyy ') | | ' -' | | To_char (Birthday, ' mm-dd '), Date (To_char (current_date, ' yyyy ') | | ' -' | | To_char (Birthday, ' mm-dd '))-current_date
From TableName where delflag=0 and status=0
and Date (To_char (current_date, ' yyyy ') | | ' -' | | To_char (Birthday, ' mm-dd '))-current_date>=0
and Date (To_char (current_date, ' yyyy ') | | ' -' | | To_char (Birthday, ' mm-dd '))-current_date<=7order by birthday desc
Three:
select Now () + interval ' 1 days "
select Now () + interval ' 1 month "
Select + ' 1 Years '
Four:
when you perform date calculations in SQL Server, use the function
CONVERT (), DATEPART (), GetDate ()
Select CONVERT (varchar), CONVERT (varchar (4), DATEPART (Year,getdate ())) + '-' + CONVERT (varchar (2), DATEPART (month, Birthday) + '-' +convert (varchar (2), DATEPART (Day,birthday)), DateDiff (day,convert (varchar), GETDATE (), 120) , convert (varchar), CONVERT (varchar (4), DATEPART (Year,getdate ())) + '-' + CONVERT (varchar (2), DATEPART (month, Birthday) + '-' +convert (varchar (2), DATEPART (Day,birthday)), 120))
From TableName where delflag=0 and status=0
Birthday desc
The date calculation function for PostgreSQL uses