Label:Our company mainly MySQL storage data, so also encapsulated a more useful MySQL common method, and then, we do a lot of interfaces, in the processing of paged query interface, there is no very good sub-query method. How SQL query statements are parsed into "paged query
1. SQL statements
Is a language
Meets ANSI standards
Keyword cannot be abbreviated
Use statements to control the definition information and data of tables in the database
SQL is the abbreviation of Structured Query Language (Structured Query Language. You can use SQL statem
The growth of SQL Server Cognition 1. I don't have to graduate or work for a long time. I only know the relationship between SQL and SQL Server Oracle and MySql. I usually think that SQL is SQL Server.2. after several years of work, I have also written a lot of
Original: SQL query performance analysisOriginal source: http://blog.csdn.net/dba_huangzj/article/details/7623926The performance of SQL query directly affects the value of the whole database, which must be treated solemnly.SQL Server provides a variety of tools, and here's a simple introduction:First, the
Access wildcard characters and SQL Server wildcard comparisons===================================================The wildcard characters for the Access library are:* match any number of characters? match the characters of any single letter
The wildcard characters in SQL Server are:% matches any number of characters_ Matches a single characterBodyI am writing a page today, also very depressed, the table
it is to increase I/O.2. Vertical and horizontal partition table, reduce the size of the table (Sp_spaceuse)3. Upgrading hardware4, according to the query criteria, index, optimize the index, optimize access mode, limit the data volume of the result set. Note that the fill factor is appropriate (preferably using the default value of 0). The index should be as small as possible, using a Lie Jian index with a small number of bytes (refer to the creatio
SmallProgramGrowth of SQL Server Cognition
1. I don't have to graduate or work for a long time. I only know the relationship between SQL and SQL Server Oracle and MySQL. I usually think that SQL is SQL Server.
2. after several years of work, I have also written a lot of
A combined query of SQL two tables uses join onFor example: Two table queries:Select U.username, T.title where User U is used to simplify the table name join is to join the other table on is the condition that represents the query U.username is the username field in the user tableThe same principle of multi-table query
to 90 points
SELECT * from SC Student where grade>=90
--use "logical expression" as a query condition ...
/*
Logical Expressions in SQL:
Not: Non-
And: With
Or: OR
*/
SELECT * FROM Student
--Check the student's table for male students aged 19 years
SELECT * from Student where Sage = Ssex = ' Male '
--Check the student's table for students ages 19 or 20 years old
SELECT * from Student where sag
What is parameterized query?
A simple way to understand parameterized queries is to think of it as just a T-SQL query that accepts parameters that control what the query returns. By using different parameters, a parameterized query returns different results. To obtain a para
Query for common methods:@Override Public List operator) { = "Select Mat_no_, sum (amount_) as Spent_amount_ from Dm_mat_month_plan where Mat_type_ =? and Dept_code_ =? and Year_ =? and Process_status_ in (1, 2) GROUP by Mat_no_ "; return dmjdbctemplate.queryforlist (SQL, Mat_type_, Dept_code_, year_); }A query that can be empty method:@Ove
, integer field. Example: Userage int
float, floating-point data is approximate. Example: Userresults float, the approximate numeric data type used to represent floating-point numeric data.
datetime, Date type. Example: Createdatetime datetime
Bit, Boolean type. Can be set to True is male, false is schoolgirl
If the content is very much, indeterminate length (such as article), can be used: nvarchar (max)6. Save the table:* If you want to modify the table, save it, and then refre
This article introduces parameterized query. I will discuss how SQL Server optimizer attempts to parameterize a query and how you can create your own parameterized query if the query can be parameterized.
This article introduces parameterized
From: http://www.itqun.net/content-detail/104196.html
Set statistics profile on
Set statistics Io on
Set statistics time on
The more CPU and IO resources a query requires, the slower the query speed. Therefore, another way to describe the query performance tuning task is, the query command should be rewri
Http://www.cnblogs.com/dubing/archive/2011/12/09/2278090.htmlRecently the company has come to a very tiger DBA 10几 years of experience here is called Cai Teacher. Let us share the precious wealth that Cai Lao has brought to us, with the consent of our Chua. Welcome other DBAs to shoot bricks
Directory1. What is the execution plan? The execution plan is dependent on what information.2, unified SQL statement to reduce parsing overhead3. Reduce the
Directory1. What is the execution plan? The execution plan is dependent on what information.2, unified SQL statement to reduce parsing overhead3. Reduce the nesting of SQL statements4. Staging intermediate results using temporary table5. The OLTP system SQL statement must take a binding variable6. The spy problem of the bound variable of the tilted field7. Begin
The more CPU and IO resources a query requires, the slower the query speed. Therefore, another way to describe the query performance tuning task is, the query command should be rewritten in a way that uses less CPU and IO resources. If the query can be completed in this way,
I. MySql Query Cache
1. Query Cache
MySQL Query Cache is used to Cache the SELECT statement we execute and the result set of this statement. The specific technical details of MySql in implementing Query Cache are similar to the typical KV storage, it is to map the SELECT statement and the
condition in Statement 7 after the on clause.Select O. ID, O. order_number, O. customer_id, C. ID, C. NameFrom orders o left Outer Join MERs C on C. ID = O. customer_id and O. order_number
The query results of statement 7 and statement 8 are obviously different, and the results displayed in Statement 8 are hard to understand. Therefore, when writing a join query, we recommend that you only follow the join
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.