If exists (select * from sys. tables where name like 'userinfo ')Drop table userinfoGoCreate table userinfo(ID int primary key identity (1, 1 ),U_Name varchar (20) not null,U_Age int not null,Address varchar (50) not null)Go
Insert into userinfo
It is useful when calling data by page or segment.
-- Retrieve the records from the table from entry m to entry N: (not in version)
Code:
Select Top N-m + 1 *From tableWhere (id not in (select top M-1 ID from Table ))
-- Retrieve the MB to N
Question: retrieve data between 100 and 200 entries in a table
Method 1: temporary tableCopyCodeThe Code is as follows: Select top 200 * into # Aa from Table order by time -- Insert the top M pen into the temporary tableSet rowcount 100Select *
Ignored magic-delay value assignment for php reference (late data Delay Binding) and value assignment binding
I am talking about the variable reference feature of php today, but what is the problem of delayed assignment? This is mainly an idea I
How to implement high-efficiency Paging for massive (massive) data display in gridview
Source NetworkProblem:The gridview shows that the aging rate of massive data is extremely low. It is obviously unrealistic to retrieve massive data from
The meaning of the limit 10000,20 scan satisfies the condition of 10020 lines, throw away the preceding 10000 lines, return the last 20 lines, the problem is here, if it is limit 100000,100, need to scan 100100 rows, in a high concurrent application,
This is what I made yesterday oh, let's take a look at the code that uses PHP to invoke the MSSQL stored procedure.
$start = isset ($_get[' start ')? $_get[' Start ']:0;$end = isset ($_get[' End '])? $_get[' End ']:0;$pagesize = isset ($_get['
One, the most common MySQL most basic way to paging:
The code is as follows
Copy Code
SELECT * from content ORDER BY id desc limit 0, 10
In the case of small and medium data, such SQL is sufficient, the only
Near the Spring Festival, the heart has already flown away from work, the following small series for everyone to organize some of the database of several paging query.
SQL Sever before 2005 version:
Select Top Page Size * from
table
In MySQL limit can achieve fast paging, but if the data to millions of when our limit must be optimized to effectively achieve a reasonable paging, otherwise may be stuck to your server oh.
When a table data has millions of of the data is a problem!
In SQL Server database operations, we often use stored procedures to implement the query data paging to facilitate the browsing of the viewer. In this article, we summarize the methods of five SQL Server paging stored procedures and compare their
Chapter TwoI. Design of distributed database System 1 Database Design OverviewDatabase design is to construct the optimal database schema for a given application environment, establish the database and its application system so that it can store the
A query for numeric data:SELECT * from Tb_name WHERE sum > 100;Query predicate:>,=,,!=,!>,!,=Two query stringsSELECT * from tb_stu WHERE sname = ' Xiao Liu 'SELECT * from Tb_stu WHERE sname like ' Liu 'SELECT * from Tb_stu WHERE sname like '%
In our long-process application development process, we will inevitably encounter multiple processes accessing the same resource (critical resources) of the situation, you must add a global lock, to achieve synchronous access to resources (only one
23 MySQL Common query statementsA query for numeric data:SELECT * from Tb_name WHERE sum > 100;Query predicate:>,=,,!=,!>,!,=Two query stringsSELECT * from tb_stu WHERE sname = ' Xiao Liu 'SELECT * from Tb_stu WHERE sname like ' Liu 'SELECT * from
Welcome to the Linux community forum and interact with 2 million technical staff. The main purpose of entering the MySQL page is to improve efficiency. Today we will briefly introduce how to build an efficient MySQL page. At
Use an SQL statement to retrieve records from the m to n records -- retrieve records from the Table from the m to the n records: (NotIn Version) SELECTTOPn-m + 1 * FROMTableWHERE (idNOTIN (SELECTTOPm-1idFROMTable) -- extracts the m to n records
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger. Directory (?) [] Chapter II Design of Distributed Database System 1 Database Design overview Database Design
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.