C # convert SQL statements into paging SQL statements and obtain the number of records SQL statements
/// /// Convert the statement into a paging SQL statement. Two SQL statements that contain paging data are used to obtain the number of records.
1. view the database version
Select @ version
Common SQL server patch versions:
8.00.194 Microsoft SQL Server 2000
8.00.384 Microsoft SQL Server 2000 sp1
8.00.532 Microsoft SQL Server 2000 sp2
8.00.760 Microsoft SQL Server 2000 sp3
8.00.818 Microsoft
SQL Server manages common SQL and T-SQL (2)
1. view the database versionSelect @ versionCommon SQL server patch versions:8.00.194 Microsoft SQL Server 20008.00.384 Microsoft SQL Server 2000 sp18.00.532 Microsoft
spelling of a person's name, but we know his pronunciation, and then we can make a matching test of the pronunciation.Soundex () is used to calculate the pronounced characteristics of a string, which is a four-character string, the first character of the feature is always the first character in the initial string, and then a three-digit numeric value.Select Sname, Soundex (sname) from studentThe result is:The meaning of the pronounced eigenvalues is
conversion from: http://www.51testing.com /? Uid-239867-action-viewspace-itemid-103705
SQLDifferences between statements, PL/SQL blocks, and SQL * Plus commands
The SQL statement isDatabaseThe language of the operation object, including the data definition language DDL, data manipulation language DML, Data Control Language DCl, and data storage
SQL Server quickly generates SQL addition, deletion, modification, and query statements, and SQL addition and DeletionAre you still coding to generate SQL statements? Are you still speechless for SQL statements that are sloppy? Are you still struggling with expressing compli
"SOUNDEX" function is the same as the first string of the target string, and the next three characters are the value codes that are worth the consonants. (a vowel is ignored unless the vowel is the first letter.) )Select @name1 as name1, @name2 as name2,--Eg:name1=allen,name2=alanSoundex (@name1) as Soundexname1,soundex (@name2) as Soundexname2,--Soundex (string
Convert a string in the format of "yyyy-mm-dd" to Java. SQL. Date:
Simpledateformat bartdateformat = new simpledateformat ("yyyy-mm-dd "); String datestringtoparse = "2007-7-12 "; Try { Java. util. Date = bartdateformat. parse (datestringtoparse ); Java. SQL. Date sqldate = new java. SQL. date (date. gettime ());System. Out. println (sqldate. gettime ()); }
In the previous chapter, we have introduced how to create an SQL azure database. This chapter describes how to use SQL Server Management Studio (SSMs) to connect to and manage SQL azure databases. Install SQL Server manage studio to prepare the teaching content.
1. First we log on to the Windows azure user management
Cannot Debug SQL: Unable to start T-SQL Debugging. cocould not attach to SQL Server process on, t-sqldebuggingWhen SSMS debug SQL script is used today, an error is reported: Unable to start T-SQL Debugging. cocould not attach to SQL
This article explains how to split an SQL statement with one or more left JOIN or right join into multiple SQL statements. MySQL query efficiency is very low, especially large data, and high concurrency, the index can not solve the problem, the best way is to split the SQL statement into multiple single table query SQL
handling of column fields SQL Case Do the column processing Sql> Select deptno,sum (SAL) from the EMP Group by DEPTNO; Select Case When deptno=10 Then ' ACCOUNTING ' When deptno=20 Then ' Reserch ' When deptno=30 Then ' SALES ' End sum (SAL) from EMP GROUP BY Deptno
handling of column fields SQL Decode There is also the case that when nothing
), SOUNDEX (Smythe)
O:select SOUNDEX (Smith), SOUNDEX (Smythe) from dual
Compare Soundex difference with Select difference (Smithers, smythers) in SQL Server
Return 0-4,4 to the homonym, 1 highest
Third, date function
37. System Time
Copy Code code as follows:
numberS:select rand () valueO:select Sys.dbms_random.value (0,1) value from dual;13. Take the symbolS:select sign ( -8) value-1O:select sign ( -8) value from Dual-1======= Mathematical Function =======14. PiS:select PI () value 3.1415926535897931O: I don't know15.sin,cos,tan parameters are measured in radiansExample: Select Sin (PI ()/2) value gets 1 (SQL Server)16.asin,acos,atan,atan2 return radians17. Radian Angle Interchange (sqlserver,oracle not
corresponding to the ASCII code numberChar (integer_expression) integer_expression an integer between 0 and 255. If the integer expression is not within this range, a NULL value is returned.Select Char (72)Returns a Unicode character that returns a specified integer codeNCHAR (integer_expression) integer_expression a positive integer between 0 and 65535. If a value beyond this range is specified, NULL is returned.Select NCHAR (1000)Returns a Unicode string with delimiters, in which the input st
) integer_expression an integer between 0 and 255. If the integer expression is not within this range, a NULL value is returned.Select Char (.) Returns a Unicode character that returns a specified integer codeNCHAR (integer_expression) integer_expression a positive integer between 0 and 65535. If a value beyond this range is specified, NULL is returned. Select nchar (+) Returns a Unicode string with delimiters, in which the input string becomes a valid SQL
. substr (string, start, count)Substring, starting from start, countSQL> select substr ('123', 13088888888) from dual;
Substr ('--------08888888
12. Replace ('string', 's1', 's2 ')String: the character or variable to be replaced.String to be replaced by S1String to be replaced by S2SQL> select Replace ('He love you', 'hes', 'I') from dual;
Replace ('heloveyou', 'hes', 'I ')------------------------------I love you
13. soundexReturns a string with the same pronunciation as a given string.SQL> Crea
Alias for SQL1. You cannot use the alias of the column name in the WHERE clause, that is, the select name T from EMP where t>2999; is not allowed2. Benefits of using aliases:Improve the readability of SQLImprove the efficiency of SQL parsing executionGrammar checkSemantic checkShared Pool ChecksBuild the execution treePerform3. Hard parsing and soft parsing of SQL?Execution Order of SQL1. From statement--wh
1. View the version of the database
SELECT @ @version
Several common SQL Server patched version numbers:
8.00.194 Microsoft SQL Server 2000
8.00.384 Microsoft SQL Server SP1
8.00.532 Microsoft SQL Server SP2
8.00.760 Microsoft SQL Server SP3
8.00.818 Microsoft
1. View the version of the database
SELECT @ @version
2. View the machine operating system parameters of the database
EXEC master.. xp_msver
3. View Database Startup Parameters
sp_configure
4. View Database Startup time
Select CONVERT (varchar, login_time,120) from master. sysprocesses where spid=1
To view the database server name and instance name
print ' Server Name ... ...: ' + CONVERT (varchar (), @ @SERVERNAME) (@, @)
print ' Instance ... ...: ' + CONVERT (varchar) (@ @SERVICENAME)., D., ".
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.