indexes should also be considered in conjunction with the frequency of use of the index--for clustering factors, only by organizing the data on the table and by adjusting the order of the corresponding indexed columns--Information about indexed columns on a single table Gx_adm@cabo3gt ; @idx_info Enter value for Owner:gx_adm enter value for TABLE_NAME:CLIENT_TRADE_TBL table_name index_name Cl_nam cl_pos STATUS Idx_typ dscd---------------------------------------------------------------
Variable
Description
@PageSize
Total number of records displayed per page
@MiddleIndex
Index of intermediate pages
@PageCount
Total Paging
@LastIndex
Index of last page
@RecordCount
Total number of records in datasheet
@TableName
database table name
@PageIndex
Index of current page
@PrimaryKey
Primary key field Name
@FirstIndex
Index of the first page
@QueryFields
Set of fields to query
Variable
Defined
@PageCount
(int) Math.ceiling (double) @RecordCount/@PageSize)
@FirstInd
deadlock occurs, and causes transaction 2 to roll back, which makes transaction 1 no longer waiting for the lock of transaction B to continue execution. So how does the InnoDB storage engine detect a deadlock? In order to understand this problem, we first check the state of InnoDB at this time:Show Engine InnoDB Status\g------------------------LATEST detected DEADLOCK------------------------2018-01-14 12:17:13 0x70000f1cc000* * * (1) TRANSACTION:TRANSACTION 5120, ACTIVE sec starting index readM
% 25 AnD (SeLEcT AsC (MID (username,) FrOM (SeLEcT ToP 1 * FrOM (SeLEcT ToP 1 * FrOM admin OrDEr By 1) sub OrDEr By 1 dEsC) sub) = 109 AnD % 25 = the first user is mHttp://www.xxx.com/s.asp? K = 1% 25 AnD (SeLEcT AsC (MID (username,) FrOM (SeLEcT ToP 1 * FrOM (SeLEcT ToP 1 * FrOM admin OrDEr By 1) sub OrDEr By 1 dEsC) sub) = 97 AnD % 25 = the second user isHttp://www.xxx.com/s.asp? K = 1% 25 AnD (SeLEcT
$sql 1= "SELECT * from Y_cate ORDER by ASC";
$result 1=mysql_fetch_array (mysql_query ($sql 1));
Var_dump ($result 1);
foreach ($result 1 as $ke = = $a) {
echo $a. "
";
}
?>
I want to use foreach to loop through the output of all the data in the Cate table, why just output one piece of data? Ask for answers
Reply to discussion (solution)
$sql 1= "SELECT * from Y_cate ORDER by ASC"; $result 1 = mys
‑ view name]5 [where query conditions]6 order by [sorting field] ASC sort DESC78 select top pagesize fields to be displayed9 from [Table Name ‑ view name]10 where [sorting field]> = @ col11 [and query conditions]12 order by [sorting field] ASC sort DESCTake the Products table in the northwind database as an example. Assume that 10 pieces of data are displayed on one page, and categoryid = 3 is the query co
row lock (s) # There are 2 rows to lock MySQL thread id 1, OS thread handle 0x7f55ea639700, query id 81 localhost root updating # The thread ID of the transaction = 1 delete from t1 where a = 1 ## THIS is the SQL statement executed by the current transaction *** (1) WAITING FOR THIS LOCK TO BE GRANTED: # record locks space id 12 page no 3 n bits 80 index 'primary' of table 'test '. 't1' trx id 110E lock_mode X locks rec but not gap waitingRecord lock, heap no 2 physical record: n_fields 4; comp
is important to perform descending order.
End
Else
Begin
Set @strTmp = ' > select Max '
Set @strOrder = ' ORDER BY ' + @fldName + ' ASC '
End
If @PageIndex = 1
Begin
If @strWhere!= '
Set @strSQL = ' SELECT top ' + str (@PageSize) + ' + @strGetFields + ' from ' + @tblName + ' where ' + @strWhere + ' + ' + @str Order
Else
Set @strSQL = ' SELECT top ' + str (@PageSize) + "+ @strGetFields + ' from ' + @tblName + ' +" + @strOrder
--If the fir
Create PROC p_viewpage_a
/*
Nzperfect [No_miss] Efficient common paging stored procedure (bidirectional retrieval) 2007.5.7 qq:34813284
Warning: Tables or views that apply to a single primary key or existence of a unique value column
Ps:sql statement is 8000 bytes, please note that the incoming parameter and the total SQL length do not exceed the specified range
*/
@TableName VARCHAR (200),--table name
@FieldList VARCHAR (2000),--Display column names, if all fields are *
@PrimaryKey VARCHAR (100
ALTERATION_CHR=CHR (Bitxor (ASC (SUBST (encrypt_chr1,i,1)), ASC (SUBST (encrypt_chr2,i,1)))
THIS.RETURN_DATA=THIS.RETURN_DATA+CHR (Bitxor (ASC (SUBST (encrypt_password,i,1)), ASC (Alterati
ON_CHR)))
ENDfor
Return This.return_data
2. In the data library file to encrypt
If there is a number of data library file C:\
Copy CodeThe code is as follows:
DECLARE @TotalCount int
DECLARE @TotalPageCount int
exec p_viewpage_a ' type1 ', ' * ', ' id ', ', ' ID ASC ', 1,0,4,3, @TotalCount output, @TotalPageCount output
SELECT * FROM Type1
Create PROC p_viewpage_a
/*
Nzperfect [No_miss] Efficient common paging stored procedure (bidirectional retrieval) 2007.5.7 qq:34813284
Warning: Tables or views that apply to a single primary key or existence of a unique value column
Ps
Label:SQL 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:The code is as follows:Select top article WHERE ID not in (
sql:1999 Basic SyntaxSELECT [DISTINCT] * |Column Name[ as]alias,........ fromTable Name 1[alias 1][Cross join table name 2 alias 2]|[NATURAL Join table name 2 alias 2][Join table Name 2 alias 2 USING (associated column name)][Join table Name 2 Alias 2 on (association condition)][Left | Right | Full OUTER JOIN Table 2 on (association condition)][WHERE condition (s)][Order by sort field 1,asc| DESC, sorted by field 2
MySQL thread ID 1, OS thread handle 0x7f55ea639700, query ID bayi localhost Root updating # # The thread of the transaction id=1delete from T1 where A=1 # # This is the current transaction execution sql*** (1) Waiting for this LOCK to be granted: # # above S QL waits for lock information record LOCKS Space ID of page No 3 n bits index ' PRIMARY ' of table ' test '. ' T1 ' Trx ID 110E lock_mode X LOCKS re C but not gap Waitingrecord lock, heap No 2 physical record:n_fields 4; Compact format; Inf
------------------------
LATEST detected DEADLOCK
------------------------
140824 1:01:24
(1) TRANSACTION:
TRANSACTION 110E, active starting SEC index Read # # transaction id=110E, active 73s
MySQL tables in use 1, locked 1
Lock WAIT 3 lock struct (s), Heap size 376, 2 row lock (s) # # There are 2 row locks
MySQL thread ID 1, OS thread handle 0x7f55ea639700, query ID bayi localhost root updating # # threads for the transaction id=1
Delete from T1 where a=1 # # This is the SQL
The code is as follows
Copy Code
Create PROC P_viewpage/**//*Nzperfect [No_miss] Efficient common paging stored procedure (bidirectional retrieval) 2007.5.7 qq:34813284Warning: Tables or views that apply to a single primary key or existence of a unique value columnPs:sql statement is 8000 bytes, please note that the incoming parameter and the total SQL length do not exceed the specified range*/@TableName VARCHAR (200),--table name@FieldList VARCHAR (2000),--Display column names,
SQL Server database paging query has been a short board of SQL Server, idle, come up with several methods, assuming that there are table article, Field ID, year ... (other omitted), Data 53,210 (customer real data, quantity is not large), paging query each page 30, query page 1500th (ie 第45001-45030条 data), field ID clustered index, Year no index, SQL Server version: 2008R2
The first scheme, the simplest, the common method:
Copy Code code as follows:
Select Top * from ARTICLE WH
the ASC code is negative or not to determine whether it occupies two bytes. In this case, is it correct (ASC () to obtain the ASC code of a character, CHR () obtains the characters corresponding to an ASC code)
(4) How can I obtain the ASC code in JavaScript? Please help me
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.