1. Description: Copy table (copy structure only, source table name: A new table name: B) (Access available)Law one: SELECT * into B from a where 1<>1 (SQL Server only)Law II: SELECT top 0 * into B from a 2. Description: Copy table (copy data, source
String intercept left (), right (), substring (), Substring_index ()Left (Str,length)Right (Str,length)SUBSTRING (str,pos) starts at POS character position until end (POS is negative for reciprocal)SUBSTRING (Str,pos,len) starts at POS character
1: From SQL and Index direction (most basic)To do this, you can use the tool mysqldumpslow that comes with MySQL, or you can use a third-party tool to pt-query-digest this more carefullySecond: From the table structure directionSpecific operation: A
When MySQL create table, it is sometimes necessary to specify data_type lengthHttp://dev.mysql.com/doc/refman/5.5/en/create-table.htmlBut the length of the type a lot of development does not understand, understanding can be divided into two1) Number
Select Sql_calc_found_rows * FROM (SELECT * To oses_vehdata201606 UNION ALL SELECT * from oses_vehdata201605) T wher e 1=1 and t.check_time between ' 2016-06-23 00:00:00 ' and ' 2016-06-23 23:59:59 ' ORDER BY check_time DescResults: 45.66 S,
My environment: Mysql:mysql-essential-5.1.51-win32JDBC Driver: I've uploaded it to csdn. Previous: http://download.csdn.net/source/3451945jmeter:jmeter-2.4 any version is OK.1. First we have a database that can be tested, of course, there must be
Need to use the MySQLdb module, the code is as follows1 ImportMySQLdb2 3hostname ="10.20.10.111"4Username ="User"5passwd ="123456"6Port = 33067conn = MySQLdb.connect (host = Hostname,port = Port,user = USERNAME,PASSWD = passwd)#note here to write
Stored procedure: procedureThe concept is similar to a function, which is to encapsulate a piece of code.When the code is executed, it can be implemented by invoking the stored procedure.In the encapsulated statement body, you can use If/else,
1: Use the show statement to find out what database currently exists on the server:Mysql> SHOW DATABASES;2:2. Create a database Mysqldatamysql> CREATE DATABASE Mysqldata;3: Select the database you createdmysql> use Mysqldata; (press ENTER to appear
Example 1: Establishing a database named XHKDBmysql> CREATE DATABASE xhkdb;Example 2: Displaying a databaseCommand: Show databases (note: There is a last s)mysql> show databases;Example 3: Deleting a databaseExample: Delete a database named
[Email protected] ~]# mysqldump-uroot-p123 --flush-logs--all-databases >fullbackup_sunday_11_pm.sql-- Warning:skipping The data of table mysql.event. Specify the--events option explicitly.This is because mysqldump default is not to back up the
1, Test table structure:mysql> desc Test_user;+---------+-------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +---------+-------------+------+-----+---------+----------
MySQL supports setting the session variable and has the ability to use it into the trigger, so you can set the trigger to fail indirectly. The idea is: A session variable is set before execution, and the value of the variable is judged during
The WHERE clause with and and or precedence is and high, and any WHERE clause that uses and and or operations should use parentheses to explicitly group the operators.
Between operations include boundaries.
The in operator accomplishes the
Summary of MySql Stored Procedure learning and mysql Stored Procedure
What is a stored procedure:
Stored procedures can be said to be a record set, it is a code block composed of some T-SQL statements, these T-SQL statement code implements some
MySQL Aggregate functions
I. AVG
AVG (col)
Returns the average value of a specified column.
Ii. COUNT
COUNT (col)
Returns the number of non-NULL values in the specified column.
3. MIN/MAX
MIN (col): returns the minimum value of a specified
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service