Tags: style io color OS SP strong on size newSometimes, we need to concatenate the data obtained from different fields. Each database provides a way to achieve this:
Mysql:concat ()
Oracle:concat (), | |
SQL Server: +
The syntax for CONCAT () is as follows:CONCAT (String 1, String 2, String 3, ...
Three database date conversions comparison:http://blog.csdn.net/zljjava/article/details/17552741SQL type conversion function: Cast (type1 as Type2)Date types in the database SQL SERVERDATE 1970-01-01DATETIME 1970-01-01 00:00:00OracleDATE 2015-08-07 17:34:37TIMESTAMP 1970-01-01 00:00:00.000000 is the extended type of date, with fractional secondsDate-to-string OracleTo_char (sysdate, ' yyyy-mm-dd ')Select To
. Resetting the connection string will reconfigure the values of all connection strings, including passwords. The default value is false.
Pooling(Pool ):Determine whether to use the connection pool. If the value is true, the connection will be obtained from the appropriate connection pool, or, if necessary, the connection will be created and then added to the appropriate connection pool. The default value is true.
User ID(UserID):The account name
. Resetting the connection string will reconfigure the values of all connection strings, including passwords. The default value is pseudo.
Pooling (pool): Determines whether connection pooling is used. If the value is true, the connection is obtained from the appropriate connection pool, or, if necessary, the connection is created and then added to the appropriate connection pool. The default value is true.
User ID (User ID): The name of the account
This article uses an SQL statement to merge multiple rows in a column of an SQL table into a single value and a string group. If you need it, refer to "merge.
This article uses an SQL statement to merge multiple rows in a column of an SQL table into a single value and a
Ref: [Abusing MySQL string arithmetic for tiny SQL Injections]
Let's look at this scenario first.The table structure is as follows:
mysql> desc admin;+----------+--------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+----------+--------------+------+-----+---------+----------------+| id | mediumint(9) | NO | PRI | NULL | auto_inc
PreparedStatement preparestatement (String sql,int autogeneratedkeys) throws SQLExceptionAutogeneratedkeys can be evaluated as Statement.return_generated_keys or Statement.no_generated_keysWhen you take the Statement.return_generated_keys value and use an INSERT statement, you can remove the value of the automatically growing column in the newly inserted data row, for example:1 BooleanAutocommit =conn.getau
SQL to determine whether a string contains numbers and letters.
Determine whether a letter is contained
select PATINDEX('%[A-Za-z]%', ‘ads23432')=0
(If a letter exists, result> 1)
Determines whether a number exists.
PATINDEX('%[0-9]%', ‘234sdf')=0
(If a number exists, result> 1)
How does SQL determine whether a string
From: http://blog.sina.com.cn/s/blog_4b93170a0100biyp.html
Sometimes, we need to link the data obtained from different columns. Each database provides methods to achieve this purpose:
MySQL: Concat ()
ORACLE: Concat (), |
DB2: Concat (), |
SQL Server: +
The Concat () syntax of MySQL is as follows:
Concat (string 1, string 2,
Tags: SQL base string and operator use (iii)SQL Base String Use:The string can be a character, number, date in the SELECT listHowever, dates and characters can only appear in single quotation marks . Each time a row is returned, the stri
Label: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 on
GO
SETQuoted_identifier on
GO
/*by Kudychen 2011-9-28*/
CREATE function [dbo].[splitstring]
(
@Input nvarchar(Max),--input string
integer. If integer_expression is negative, an empty string is returned.Return typeVarchar
Right (character_expression, integer_expression) returns the number of integer_expression characters specified from the right.ParametersCharacter_expressionAn expression composed of character data. Character_expression can be a constant, variable, or a column of character or binary data.Integer_expressionIs the starting position, expressed in a positive integer
CONVERT (varchar), getDate (), 120) Select CONVERT (VARCHAR), GETDATE (), 23) functions nbsp NBSP parameters/Features Getdat E () NBSP ; Return to the current date and time of the system DateDiff (interval,date1,date2) NBS P Returns the difference between Date2 and date1 two dates in interval specified date2-date1 DATEADD (interval,number,date) interval specified, plus the date after number DatePart (interval,date) nbs
SUBSTRINGReturns part of a character, binary, text, or an image expression. For more information about valid Microsoft®sql Server™ data types that can be used with this function, see Data types.
Grammar
SUBSTRING (expression, start, length)
Parameters
expression
is a string, binary string, text, image, column, or an expression that contains a column. Do not use
. NET SQL Server Connection string syntaxThe connectivity of the database has evolved into a standard aspect of application development. The database connection string is now a standard requirement for each project. I found myself in order to find the syntax that I need, I often have to copy the connection string from
Found today
Microsoft ole db provider for SQL Server (0x80040e07)
A syntax error occurs when converting a string to datetime.
. Check the program and find that the current time obtained in the program uses now () and response. the write output indicates that "Morning" or "Afternoon" appears in the string, while the datetime (8) Type of the
SQL statement
Copy Code code as follows:
Reverse (substring reverse (path), 1,charindex ('/', reverse (path))-1)
How SQL takes out the character to the right of the last special character in a string, for example: 10*20*300, how do I get 300?
Use reverse with charindex to achieve.
Reverse is to invert the
Label:Original: SQL query statement group BY, string mergeMerge column Values--*******************************************************************************************table structure with the following data: ID value----- ------1AA1BB2AAA2BBB2CCC needs to get results: ID values------ -----------1AA,BB2AAA,BBB,CCC namely: Group by ID, sum of Value (string addit
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.