Label:Execution Order: 1.FROM: Performs a cartesian product of the first two tables in the FROM clause to generate a virtual table VT1 2.ON: Apply on filter to VT1 table only rows that satisfy true are inserted vt2 3.OUTER (Join): Adds rows that are not found in the OUTER join reservation table (preserved table) as outer rows to the VT2 Generate T3 If the from contains more than two tables repeat steps and steps for the result table and the next table generated by the previous junction directly
Right ()
Returns the character to the right of a string
RTRIM ()
Remove the space to the right of the string
UPPER ()
Convert a string to uppercase
For example: Select Name,upper (name) as Upname...Result: Chen ChenDate and time processing functionsThe DATEPART () function has two parameters, one is the returned component, and the date from which the component is returned.For example: Retrieving all orders for 2012 yearsSelect Or
Select Sclass class, COUNT (*) class total number of students,SUM (case if sgender=0 then 1 else 0 end) Number of females,SUM (case if sgender=0 then 1 else 0 end) *1.0/count (*) Percentage of girls,SUM (case if Sgender=1 then 1 else 0 end) Number of males,SUM (case if Sgender=1 then 1 else 0 end) *1.0/count (*) Percentage of boysFrom student GROUP by Sclass ORDER by sclass ASCSQL a SQL statement statistics
, type, sum (source_size) source_size,Sum (parsed_size) parsed_size, sum (code_size) code_size, sum (error_size) error_size,Sum (source_size) + sum (parsed_size) + sum (code_size) + sum (error_size) size_requiredFrom dba_object_sizeGroup by type order by 2;
10. Monitor the log cache hit rate in SGA, which should be less than 1%
Select name, gets, misses, immediate_gets, immediate_misses,Decode (gets, 100, misses/gets *) ratio1,Decode (immediate_gets + immediate_misses, 0, 0,Immediate_misses /
Label:1. Select statement Constituent element 1.1 SELECT *Avoid using SELECT *When you want to list all columns in the SELECT clause, it is a convenient way to refer to ' * ' Using a dynamic SQL column. Unfortunately, this is a very inefficient approach. In fact, during parsing, SQL converts ' * ' to all column names, which is done by querying the data dictionary
Ii. Improve SQL statements
Many people do not know how SQL statements are executed in SQL server. They are worried that the SQL statements they write will be misunderstood by SQL SERVER. For example:
Select * from table1 where name = 'hangsan' and tID> 10000
And execution:
S
configuration file information executed by the current statement, the execution of steps, and other information, using the same method.
After executing the query, in addition to displaying the result collection executed, it also shows the relevant configuration information of the SQL statement execution, which is displayed in the form of a record tree, corr
Transferred from: http://www.jquerycn.cn/a_15010To show you how to use C # to verify the correctness of SQL statements, like the detection code in SQL Query Analyzer function, the need for friends, you can refer to.The following knowledge is required:SET parseonlyChecks the syntax of each Transact-SQL statement and ret
methods of emptying SQL Server log files from the 10thOne way: Empty the log.1. Open Query Analyzer, enter command dump TRANSACTION database name with NO_LOG2. Open Enterprise Manager again--right click on the database you want to compress--all tasks--shrink the database--Shrink the file--Select the log file--in the contraction mode to choose to shrink to XXM, here will give an allowable contraction to the minimum number of M, directly enter this num
1. The query statement is select * from t_table; The exported data format is as follows:2. Back up the data text, then open it using notepad++, then copy the data to the new TXT and replace it as follows:1) will "| "Delimiter (delimiter of different fields), replace with ', ' is the delimiter of the different fields in the SQL statement;2) Leave the leftmost "|"
Chapter 4 SQL statement ProcessingBefore adjustment, we need to know some background knowledge. Only by knowing this background knowledge can we better adjust SQL statements.This section describes the basic process of SQL statement processing, including:· Query
Tags: style blog http color OS data width 2014are you still tapping the code to generate the SQL statement? Are you still having a problem with the SQL statements that were sloppy? Are you still tangled in the idea of how to express complex SQL statements? If your answer is yes, then you're out, come on. Apply
Many people do not know how SQL statements are executed in SQL Server. They worry that SQL statements they write will be misunderstood by SQL Server.
Many people do not know how SQL statements are executed in SQL server. They are
, Memusage, login_t IME,4 Last_batch, Ecid, Open_tran, status, SID, Hostname, program_name, hostprocess, cmd, Nt_domain, Nt_u Sername,5 net_address, Net_Library, Loginame, Context_info, sql_handle, Stmt_start, Stmt_end, request_id 6 fromSys.sysprocesses asSP17 WHERE(Blocked 0) and(dbo. Diglock (spid, spid)= 1) Query view v_deadlock_process, if there is a deadlock in the current SQL Server, the query is displayed to the record Select * from [dbo]. [
, and the SQL statement is as follows:Select Name,state_desc from sys.databasesVisualize setting Database state:Set to offline: Open the database in Microsoft SQL SERVER Management, right-click on the database, select Tasks-> Offline in the right-click menuSet to Online: if the current state of the database is offline, you can open the database in Microsoft
The performance of the system is not ideal, except in part because the application load does exceed the actual processing capacity of the server, more because the system has a large number of SQL statements need to be optimized. In order to achieve stable execution performance, the simpler the SQL statement, the better. For complex
SQL Server database table writing operations (database creation, table creation, and statement modification), SQL Server database creation
Learning points:
SQL-SQL statements. The head should have courage, and the head should have confidence. To learn, to be proud, to take a
This document is compiled and summarized based on relevant information. It mainly describes the most authoritative and correct methods and steps for obtaining SQL statement execution plans in Oracle databases.
This document is compiled and summarized based on relevant information. It mainly describes the most authoritative and correct methods and steps for obtaining SQL
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.