Datediff usage in SQL Server
Datediff function [Date and Time]
FunctionReturns the interval between two dates.
SyntaxDatediff (date-part, date-expression-1, date-expression-2)
Date-part:Year | quarter | month | week | Day | hour | minute |Second |
DATEDIFF function [date and time]The function returns the interval between two dates.Grammar DATEDIFF (Date-part, date-expression-1, date-expression-2)Date-part:year | Quarter | Month | Week | Day | Hour | Minute | Second | MillisecondThe parameter
Address: http://sunboyyyl.blog.163.com/blog/static/224738120112874910613/
Datediff function [Date and Time]
Function: returns the interval between two dates.
SyntaxDatediff (date-part, date-expression-1, date-expression-2)
Date-part: Year |
DATEDIFF function [date and time]FunctionReturns the interval between two dates.GrammarDATEDIFF (Date-part, date-expression-1, date-expression-2)Date-part:Year | Quarter | Month | Week | Day | Hour | Minute | Second | MillisecondParametersDATE-PART
/* -- Sybase paging operation --*/-- Method 1:--*************************************** ******-- Based on the number of start and end records-- @ Sqlstr is a common query statement, which cannot contain existing-- Identity field, otherwise the
Length and syntax analysisDatalength (char_expr)Returns the length of characters in char_expr, ignoring trailing null characters.Substring (expression, start, length)Returns some strings.Right (char_expr, int_expr)Returns the int_expr character on
Sybase database common functions one, string functions1,isnull (EXP1,EXP2,EXP3,...): Returns the first non-null value, usage with coalesce (EXP1,EXP2[,EXP3 ...]) Same2,trim (exp): remove both spaces;3,dateformat (Date_exp,date_format): Date type to
BULK insert A from ' c:/cdr201301.txt '--BULK Insert TableSp_iqcolumn (' Tv_user ')--View data columns in a table/*case. When condition selection */Select DISTINCT case When Tv_vod.series_flag = 1 then tv_vod.series_id else tv_vod.program_id end
If there is a contiguous number column in the staging table to be generated, or a continuous date column, as follows:2012-1-12012-1-22012-1-3... ...It can be written like this:DECLARE @begin datetime, @end datetimeSet @begin = ' 2012-1-1 'Set @end =
In Sybase database, the Descriptive database language (SQL) is the most successful and widely used database language, which has become the international standard of relational database language. This mainly benefits from its two major advantages:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.