Three days select * from T_news where DateDiff (Day,addtime,getdate ()) = 0a week select * from T_news WHERE (DATEPART (wk, addtime) = DATEPART (wk, GETDATE ())) and (DATEPART (yy, addtime) = DATEPART ( YY, GETDATE ()))Note: You cannot use the
Long time no write, today wrote a traversal of the number of days stored procedures, put out to share.
DeclareSqlString VARCHAR2 (32767);Tempdate number (8,0);Lnm_datefrom number (8,0); --Start timeLnm_dateto number (8,0); --End
1, 30 trading days, the share price fell to half of the stock: XG: (HHV (c,30)-c)/HHV (c,30) >0.5; 2, today's volume is 5 days on average twice times moreXg:v>ma (v,5) * *; Amount of shrinkage Vol/ma (vol,10) 3, within two days, the cumulative fall
SQL Server Date and Time Processing set
When the convert date conversion format is 20 or 120, the resulting string does not contain milliseconds.For example, select convert (varchar (23), getdate (), 120 or 20)21:46:43
When the date conversion
My colleague asked a very simple question: how can I retrieve the minimum value of another column in each partition?
create table t1 (int c1, int c2);
If the partition is based on C2, 0-10, 10-20, 20-30, 30-40, 40-50
insert into t1
Recently in doing an attendance system, attendance is mainly concerned about absence, late and early leave, the current card controller can record the user name and clocking time, the user may clock several times a day, but also may one day only
1. Please wait until then. First meeting.
2. There are too many other users. Please take care of it.
3. zookeeper has been completed before (zookeeper) has been released. Please take care of it.
4. When there are too many threads, there are too many
CONVERT (Data_type,expression[,style])CONVERT (varchar (10), field name, conversion format)
DescriptionThis style is generally in the type of time (datetime,smalldatetime) and String type (Nchar,nvarchar,char,varchar)When they are converted to each
Reproduced in this blog, the original blog: http://blog.csdn.net/baiduandxunlei/article/details/9180075CONVERT (Data_type,expression[,style])CONVERT (varchar (10), field name, conversion format)DescriptionThis style is typically in the time type
CONVERT (Data_type,expression[,style])CONVERT (varchar (10), field name, conversion format)DescriptionThis style is typically in the time type (Datetime,smalldatetime) and the string type (Nchar,nvarchar,char,varchar)It is only used when converting
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.