Sometimes we use the bulk operation to split the string, but SQL Server does not have the Split function, so you have to implement it yourself. There's nothing to say, just take it with the friends you need.SETAnsi_nulls onGOSETQuoted_identifier
Sum is the standard SUM function in an SQL statement, and the SUM function returns null if there are no records that match the criteria.But in most cases, we want it to return 0 instead of NULL if the condition record is not met, so we can use the
Format:CONVERT (Data_type,expression[,style])DescriptionThis style is typically in the time type (Datetime,smalldatetime) and the string type (Nchar,nvarchar,char,varchar)It is only used when converting to each other.Example:SELECT CONVERT (varchar (
SQL has a variety of functions, the following will introduce you to the SQL IsNull function, including its syntax, comments, return type, etc., for your reference, I hope you learn SQL can be helpfulISNULLReplaces NULL with the specified replacement
If you want to remember the records in a table for random display, or randomly extract a record, we do not need to write a long stringProgramCodeHow can we create a random number and then make a so-called "random record"? You only need to use a
Introduction to the RAND function in SQL Server and Implementation of the interval random numeric function,
During work, you will encounter tasks such as SQL Server simulated data generation and random filling of numeric column values (such as
SQL 21:10:02 read 1029 comments 0 font size: large and small subscriptions
STR () function in SQL
Declare @ number smallintSet @ number = 2Select cast (replace (STR (@ number, 3), '', '0') as char (3 ))
STR function [String]Function
Returns
There is a ROW_NUMBER function in SQL Server2005, which will number each row returned by the SELECT statement starting from 1 and assign it a continuous number. After a sorting standard is applied during a query, the sequence can be consistent only
Sometimes we use the bulk operation to split the string, but SQL Server does not have the Split function, so you have to implement it yourself.-- =============================================--Author:chenlong--Create date:2015-02-02--Description:
Because a table field in a database contains more HTML tags, you now need to modify the fields of the database to replace the HTML tags. Of course I can write a program to modify, after all, a bit of trouble. Executes directly in Query Analyzer, but
Text transfer from Freespider to WeiboLook at other people's SQL today look at this inside there are also decode () function, has never been in contact with the Internet to check a bit, but also very useful for a function, write down hope to help
The Replace function was used in the modification operation yesterday.Replace functionReplaces all occurrences of the second given string expression in the first string expression with a third expression.GrammarREPLACE ( ‘string_expression1‘ ,
The cast function is used to explicitly convert an expression of a data type to another data type. The argument to the CAST () function is an expression that includes the source value and the target data type separated by the AS keyword.First, the
LEN (' T ') =1LEN (' T ') =2Be aware of the decomposition of strings in the database, such as ' ^ ' separating ' X ^ t ', to be aware that the last ' t ' is broken down to ' t 'The following code can be used to complete the
A function module in the project used a scalar value function, and the function of the ceiling () function of the use of their own to find some information, the SQL of these functions to make a simple record, to facilitate their own learning. There
Introduction to the Decode () function in SQLLook at other people's SQL today look at this inside there are also decode () function, has never been in contact with the Internet to check a bit, but also very useful for a function, write down hope to
1 /**2 * Calculate the difference of two time, the number of days, years, months, minutes, number of seconds3 * 4 * @paramDatetype The type of difference between two times to get, for example, the number of days to get a two time difference? or
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.