(1) Try to select smaller columns;(2) to index the more frequent fields in where;(3) Avoid using * in select;(4) Avoid the use of calculations, not-in and (5) Use limit1 when only one row of data is needed;(6) To ensure that the single-table data does not exceed 200w, real-time partition table;For a slow query, you can use explain to analyze the statement's specific execution.How do you describe how SQL statement
I encountered a problem with using the stored procedure today. I used it for the first time. I used the Enterprise Manager to create a stored procedure. I just gave a name and didn't want to write anything in it. I saved it, later I used it, so I opened it for modification. I changed the process name to the parameter to the return value. The syntax passed. Make sure that the error message is displayed:
"Error 21037: [SQL-DMO] The name specified in th
{Describe | DESC} table_name[Col_name -- supports wildcard % _]:
Explain table_name:
Explain[Extended | Partions]Select clause; -- Get the statement execution plan
Use db_name; Change the current database,
Prepare prepared_statement_name from {'text constant '| text variable };
Text can be a lot of single SQL statements, not just select, insert, delete, update.
The text cannot be multip
SQL Server converts the data of a field into a string using a statement. SQL Server
For example, data column NameCopy codeThe Code is as follows:NameABCDFinal ResultCopy codeThe Code is as follows:A * B * c * d *
Declare @ test table (namevarchar (10 ))Insert into @ testvalues ('A'), ('B'), ('C'), ('D ');Select distinct(Select cast (name asvarchar (2) + '*' fro
Tags: style blog color ar strong for data div SPDescription--PRIMARY KEY constraint (Primary key constraint): The data of the primary key column is required to be unique and is not allowed to be empty.--Unique Constraint: Requires the column to be unique, allowed to be empty, but only one null value can occur.--Check Constraint: A column value range limit, formatting restrictions, and so on, such as age-related constraints.--Default Constraint: The default value of a column, such as our male cla
Tags: detail href replacement symbol ATI tar MyBatis BSP bodyBecause this is an XML file that does not allow characters like ">" to appear Use the escape character to replace > and XML escape character
Field
symbols
Description
Less than sign
GT;
>
Greater than sign
amp;
And
apos;
‘
Single quotation marks
quot;
"
Double quotes
1.in when the query condition is ListSelectId="getmultimomentscommentscounts"Resulttype="int">SelectMoment_comment_count fromTbl_moment_commentcountwhereMidinchforeachitem="Item"index="Index"collection="List"open="("Separator=","Close=")">#{item}foreach> Select>.1 if the type of the parameter is list, then when used, the collection property must be specified as a list
select id= "findbyidsmap" resultmap="Baseresultmap">
Select
include refid="base_column_list" />
From Jria where
Today, a guy said to create a database, made a half-day did not fix, accustomed to the graphical interface, these things have forgotten all back to the teacher ...1 Use [Master]2 GO3 IF EXISTS(SELECT 1 fromsysdatabasesWHERENAME=N'hktemp')4 BEGIN5 DROP DATABASEHktemp--Delete Database First if database exists6 END7 GO8 CREATE DATABASEhktemp9 onTen PRIMARY --creating the primary database file One ( ANAME='hktemp', -FILENAME='E:\Databases\HkTemp.dbf', -SIZE=5MB, theMaxSize=20MB, -FileGrowth=1MB -
second is the code to be executed by the original program, splicing the data entered by the user.
4. SQL syntax Specification
1. Use less null values as the query condition. There are two reasons: 1) the null value will not be able to use the index, it will affect the database performance, as far as possible in the default value, when inserting data automatically let the database fill in the default value 2) it is easy to generate a null value perman
PreparedStatement is an interface in java. SQL. It is a subinterface of Statement. When you use the Statement object to execute an SQL Statement
PreparedStatement is an interface in java. SQL. It is a subinterface of
function | Statement
Set Rs=server.createobject ("Adodb.recordset")
On Error Resume Next
Sql= "SELECT * from Your_table"
Rs. Open SQL, Conn
Rsname=rs (0). Name
For i = 1 to RS. Fields.count-1
' RSNAME=RSNAMEAMP;CHR (9) rs (i). Name
rsname=rsname "," rs (i). Name
Next
RSNAME=RSNAMEAMP;CHR (13)
Rs.close
Set rs=nothing
Conn.close
Set conn=nothing
Function E (W)
Dim
MySQL, SQL Server, and mSQL are both excellent SQL tools. Unfortunately, in the ASP environment, you do not need them to create practical SQL statements. However, you can use your Access knowledge and corresponding Access skills, coupled with our tips and skills, I believe you will be able to successfully add SQL to yo
Tags: io using ar strong data SP on C logFirst, prefaceMany database system performance is not ideal because the systems are not overall optimized, there are a lot of low-performing SQL statements. The primary reason for the poor performance of such SQL statements is the lack of efficient indexing. No index In addition to the statement itself to run slow, but als
. You can see it. Select SourceTable In the attribute box.
Click "Generate" on the toolbar to Generate a SQL statement for this table.
SET IDENTITY_INSERT [dbo]. [AnalogyData1] oninsert into [dbo]. [AnalogyData1] ([Block], [LayerCode], [ProduceDate], [OilWells], [WaterWells], [ProduceOil], [ProduceWater], [YCY], [Waterflooding], [ProduceGas], [HSL], [TotalOil], [TotalGas], [TotalWater], [AnareservoirID]) S
--
Method 1 change the query table to dynamic
Select
*
From
Sysobjects
Exec
(
'
Select ID, name from sysobjects
'
)
Exec
Sp_executesql n
'
Select ID, name from sysobjects
'
--
N is Unicode.
--
Method 2: use dynamic SQL
Declare
@ Fname
Varchar
(
20
)
Set
@ Fname
=
'
ID
'
Exec
(
'
Select
'
+
@ Fname
+
'
From sysobjects where
'
+
@ Fn
Syntax for adding fields: alter table tablename add (column datatype [default value] [null/not null],...);
Alter table tablename modify (column datatype [default value] [null/not null],...);
Syntax for deleting a field: alter table tablename drop (column );
Multiple columns are separated by commas.
Use alter table to add, delete, and modify a column.
Create a table structure:Copy codeThe Code is as follows:Create table test1(Id varchar2 (20) not null );Add a field:Copy codeThe Code is as follows
Tags: jquery backup table name mode regular expression ret win regex UIDSELECT * into new table name from XXXX new table name Best added date remind yourself which day to create var code = $ ("#editWin Input[name=code]"). Val ();var re = new RegExp (/^[0-9a-za-z]*$/g);if (!re.test (code)) {Msg.show ("Please input English or digital", 9);return false;The use of regular expressions in jquery to determine the value of the text box input is the number or the letter var noticemanids = [];var noticema
Ii. SQL statement ing file (2) add, delete, modify, query, parameters, and Cache
Mybatis 1. Introduction and configuration of mybatis + spring + MySql
Mybatis 2. SQL statement ing file (1) resultmap
Mybatis 2. SQL statement ing
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.