1. Description: database creation tutorialCreate database-name2. Description: delete a database.Drop database dbname3. Description: Back up SQL server--- Create a device for the backup dataUse masterExec sp_addumpdevice 'disk', 'testback', 'c: mssql7
Ascii (str)Returns the ascii code value of the leftmost character of the str string. If str is a Null String, 0 is returned. If 'str' is null, return null.
Mysql tutorial> select ascii ('2 ');
-> 50
Mysql> select ascii (2 );
-> 50
Mysql>
Mysql tutorial group by, sorting the records with the largest time in each record
Select a. * from test,(Select aid, max (day) max_day from test group by aid) BWhere a. aid = B. aid and a. day = B. max_dayOrder by a. install desc
Test SQL
Create
Mysql tutorial Modify Table/field Add/delete table Index
Create table test (blob_col blob, index (blob_col (10); in mysql 5.1, for myisam and innodb tables, the prefix length can reach 1000 bytes. Note that the prefix limit should be measured in
This tutorial describes how to create a trigger instance in mysql. mysql creates a trigger that is supported at mysql 5.0.2, and a trigger is a database object related to a table that is triggered when the defined conditions are met, and execute the
Grouping statistics statement for SQL data by day and month
Grouping statistics statement for SQL data by day and month/*In the database tutorial orders table, there is a "total" and a "createtime" field. Now we want to get the total of every day of
Table table1Id RegName PostionSN PersonSN1 Shandong Qilu pharmaceutical 223 22 Shandong Qilu pharmaceutical 224 23 Beijing Urban Construction Company 225 24 technology companies 225 2
The result I want to obtain is
Id RegName PostionSN PersonSN1
The and or operators are used to filter records based on more than one condition.And or operators
And or can combine two OR more conditions in the WHERE substatement.
If both the first AND second conditions are true, the AND operator displays a
SQL union syntax and Examples
SQL union allows you to query the results of two or more individuals. The consortium is different because queries are subqueries that are independent from each other. The Consortium combines these individually selected
Mysql drop table, create index, drop indexDROP [TEMPORARY] TABLE [if exists] tbl_name [, tbl_name,...][RESTRICT | CASCADE]Drop table removes one or more tables. All data and table definitions are removed, so be sure to use this command with caution!
SQL multi-Table query
Select distinct (. name, B. name), COUNT (Electric Appliance sales revenue + special monthly sales revenue) as monse, COUNT (Electric Appliance sales revenue + special annual sales revenue) as year FROM a, B WHERE. id = B.
Mysql Command-common SQL statement command code
Use G to display results vertically by lineIf a line is long and needs to be displayed in this line, it is very uncomfortable to see the results. After an SQL statement or command, you can use G
1. Use indexes to traverse tables faster. The index created by default is a non-clustered index, but sometimes it is not optimal. In a non-clustered index, data is physically stored on the data page randomly.Reasonable index design should be based
Mysql DATA character connection function CONCAT
Mysql DATA character connection function CONCAT
CONCAT () is a string connection function.REPLACE () is a string replacement function.
CONCAT (parameter 1, parameter 2 ,...)
CONCAT (string, from_str,
Optimize MySQL DataBase QueryThe simplest and safest format is the fastest disk format. the speed comes from the difficulty that data can be found on the disk. when locking an index or static format, it is very simple, just multiply the length of
Definition and usageThe mysql_affected_rows () function returns some affected pre-row MySQL operations.This function returns the success or-1 of some affected rows if the last operation fails.Syntax
Mysql_affected_rows (connection)
Connect is
Mysql saves data that web developers use every day. Let's take a look at the tutorial on using the insert statement.
When data is put into a MySQL table, it is called inserting data. When inserting data, it is important to remember the exact name
Anyone who has developed a database-driven small web application using MySQL knows that creating, retrieving, updating, and deleting tables in a relational database is a simple process. In theory, as long as you have mastered the usage of the most
Q: How can I solve the problem of MySQL 5.0.16 garbled characters?
A: The following method can be used to solve the garbled MySQL 5.0.16 problem:
1. Set phpMyAdmin
Language: Chinese simplified (zh-utf-8)
MySQL Character Set: UTF-8 Unicode
1 Guide
Selecting character sets during MySQL backup is a problem, especially for businesses with variable character sets. Utf8 is used by default for mysqldump, and utf8 is also recommended officially. However, for Chinese characters, a
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