Label:Yuanwen:http://www.jb51.net/article/35212.htmSQL Server database paging query has been SQL Server's short board, Idle to do nothing, think of several methods, assuming that there is a table article, Field ID, year ... (other omitted), Data 53,210 (customer real data, amount of small), page 30 per page, query page 1500th (that is, 第45001-45030条 data), field ID clustered index, Year no index, SQL Server version: 2008R2The first scenario, the simplest and the most common method :Copy CodeThe
Tags: des blog http ar strong data div sp ArtSQL Server database paging query has been SQL Server's short board, Idle to do nothing, think of several methods, assuming that there is a table article, Field ID, year ... (other omitted), Data 53,210 (customer real data, amount of small), page 30 per page, query page 1500th (that is, 第45001-45030条 data), field ID clustered index, Year no index, SQL Server version: 2008R2The first scenario, the simplest and the most common method:Select top article W
error (greater than 6 and less than or equal to 7) is returned when you guess 7, the length of this column is 7
. Because "top 1" means to extract the first record, it should be used if you want to guess the second record:Select top 1 len (column name) from Table NameWhere column name not in (select top 1 column name from table name)
2. ASCII code analysis method to guess the user and passwordASC () and Mid FunctionsExample: mid (column name, N, 1)ASC
. Because "top 1" means to extract the first record, it should be used if you want to guess the second record:Select top 1 len (column name) from Table NameWhere column name not in (select top 1 column name from table name)2. ASCII code analysis method to guess the user and passwordASC () and Mid FunctionsExample: mid (column name, N, 1)ASC (mdi (column name, N, 1) obtains the nth ASCII code of the "column name ".The explain statement is:And (select t
is ASC, then, the query results are executed in ascending order. If the keyword after the order by clause is desc, the query results are executed in descending order. The syntax rules are as follows:Order by column name 1 [ASC | DESC]Column name 1 indicates that the column needs to be sorted. The keywords ASC and desc are optional. If the order by clause is not
Http://www.594jsh.cn/Look.asp? Id = 75
Create proc p_viewpage_a/*Nzperfect [no_miss] efficient and common paging Stored Procedure (bidirectional retrieval) 2007.5.7 QQ: 34813284Tip: Applicable to tables or views with a single primary key or a unique value columnPS: the SQL statement is 8000 bytes. Note that the input parameters and total SQL length must not exceed the specified range.*/@ Tablename varchar (200), -- table name@ Fieldlist varchar (2000), -- displays the column name. If it is all
than 1, 1 is returned.
Instr (string1, string2 [, compare]) returns the position where the string1 string first appears in the string2 string.
Split split (string1, delimiter [, Count [, start]) Splits a string into one-dimensional arrays based on delimiter. Delimiter is used to identify the substring boundary. If omitted, use space ("") as the separator. Count returns the number of substrings.-1 indicates that all substrings are returned. Start is 1. If it is 0, or the binary comparison is omi
MySQL index optimization case analysis and mysql index Case Analysis
Order by desc/asc limit M is a scenario that I often encounter in mysql SQL optimization. Its optimization principle is also very simple, that is, using the Order of indexes, the optimizer scans data in the order of indexes and stops scanning data in M rows that meet the criteria. It looks very simple, however, I often see that many SQL statements with poor performance do not use thi
Function Encrypt (Thenumber)
On Error Resume Next
Dim N, Szenc, T, HiN, LoN, I
n = CDBL ((thenumber + 1570) ^ 2-7 * (Thenumber + 1570)-450)
If N n = CStr (ABS (n))
For i = 1 to Len (n) Step 2
t = Mid (n, I, 2)
If Len (t) = 1 Then
Szenc = Szenc T
Exit for
End If
HiN = (CInt (t) and 240)/16
LoN = CInt (t) and 15
Szenc = Szenc CHR (ASC ("M") + HiN) CHR (ASC ("C") + LoN)
Next
Encrypt = Szenc
End Function
Fun
function | decryption | string Function Encrypt (Thenumber)
On Error Resume Next
Dim N, Szenc, T, HiN, LoN, I
n = CDBL ((thenumber + 1570) ^ 2-7 * (Thenumber + 1570)-450)
If N n = CStr (ABS (n))
For i = 1 to Len (n) Step 2
t = Mid (n, I, 2)
If Len (t) = 1 Then
Szenc = Szenc T
Exit for
End If
HiN = (CInt (t) and 240)/16
LoN = CInt (t) and 15
Szenc = Szenc CHR (ASC ("M") + HiN) CHR (ASC ("C") + LoN)
Next
E
, ACTIVE2sec starting index read MySQL tablesinchUse1, Locked1LOCK WAIT2 Lock struct(s), Heap size376,1RowLock(s) MySQL thread ID -, OS thread handle0x7f70a0bd5700, Query ID993localhost root updating update t3Setbirthday='2018-01-03' whereID = +-------TRX has BEEN waiting2SEC for this LOCK to be Granted:record LOCKS space ID529Page no3N Bits theIndex ' PRIMARY ' of table ' test '. ' T3 ' Trx ID189326lock_mode X Waiting RecordLock, Heap No2Physical Record:n_fields9; Compact format; Info bits0
0
data whose role_id is 1 to 10, but the result is unexpected.
SELECT * FROM `tbl` ORDER BY `role_sort` DESC , `role_id` DESC
Can I change an SQL statement once when this problem occurs?
Desc is in descending order. it is arranged in descending order. of course 10 is placed in front of 1, and the role_id uses asc.
There is a lot of content in a table. we need to put some self-considered important content through human intervention, so that
PHP controls MySQL multi-condition query and makes a PHP database query page. now you can enter the version number and select the line for query. the selection status is unavailable. the page is as follows,
Currently, the problem is that when you open the page for the first time, all data is automatically displayed and two errors are Prompted. how to modify the error? that is, the page is blank, the message is displayed only after you click "query". The second question is how to make the "se
the meeting, the FMS broadcasts the userlist to each user who is also online. Users get userlist Just play video of several other users. How simple is the principle!2. Preparatory workIn the application of the FMS installation directory, create a new folder Test_video2 and start the FMS server3. Start codeThis code is divided into 2 parts: The server-side ASC file and the clientThere are 2 important classes in the
Do a PHP Query database page, you can now enter the version number and select Line Query, select the status can not be used, the page is as follows,
At present, the problem is that the first time to open the page is to automatically display all the data, and prompted two errors, how to modify, that is, open the page is empty, only click on the query to show, the second question is how to make the "select State" to take effect, choose to complete the execution of SQL1, choose not complete exe
result was unexpected.
SELECT * from ' tbl ' ORDER by ' Role_sort ' DESC,
You cannot change an SQL statement once you encounter this problem?
DESC is in reverse order, from large to small, 10 of course ranked in front of 1, role_id there with ASC
is a table there is a lot of content, we need to put some self-thought important content through human intervention, let him to the designated location!!!No rules, very free to let him "on", "Down
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.