Discover convert json to mysql table, include the articles, news, trends, analysis and practical advice about convert json to mysql table on alibabacloud.com
= ‘aaa’ + convert(varchar(64),@i)
select @b2= ‘bbbbbbbbbbbbbbbbbbbbbbb’ + convert(varchar(64),@i)
insert into AAA values(@a1,@b2,@i)
select @i=@i+1
end
end
Oracle test Stored Procedure
CREATE OR REPLACE PROCEDURE sp_AAA(a int)
AS
i int;
a1 varchar2(64);
b2 varchar2(255);
BEGIN
i :=1;
while i
a1 := ‘aaa’ || to_char(i);
b2 := ‘bbbbbbbbbbbbbb
default charset utf8;
# This statement creates a table. The default character set is utf8.
2. Write Data
Example 1: insert data directly using php:
A. php
The Code is as follows:
Mysql_connect ('localhost', 'user', 'Password ');
Mysql_select_db ('My _ db ');
// Note that this step is critical. Without this step, all data reads and writes Will be incorrect.
// It sets the default character set for data transmission during the database connection.
MY_TABLE.col = 1;
Column names and column aliases are case-insensitive in all cases.
Table aliases are case sensitive. The following query will not work because it uses a and A to reference aliases:
Mysql> SELECT col_name FROM tbl_name AS a WHERE a. col_name = 1 or a. col_name = 2;
If it is difficult to use uppercase or lowercase letters in the memory database and tab
"change the table" operation, the area of the operation will not be the entire table, but the table of an area, the actual " space for Time ", will undoubtedly improve the efficiency of execution. limiting factors for partitioned tables A. A table can have up to a maximum of three partitions In b.mysql5.1, the part
naming. This means that the database and table names are case-insensitive in Windows and are case-sensitive in most types of Unix systems.Oddly, the alias of the column name and column is case-insensitive in all cases, and the table alias is case-sensitive.To avoid this problem, you might want to use a combination of lowercase letters and underscores instead of any uppercase letters when defining database
, for example, if you convert a InnoDB table to a MyISAM table and turn back, all foreign keys originally defined on the original InnoDB table will be lost.Two: Dump (dump) and imports (import)If you want more control over the process of table conversion, you can choose to u
DROP TABLE IF EXISTS [Temp_table_name];
Create temporary table [Temp_table_name] Select Col1,col2,... from [table_name];
ALTER TABLE [Temp_table_name] Add unique idx_col1 (col1);
Through the above operation, the warning problem occurs many times. Through the query and tracking debugging source code, there are the following clues and processing methods:
The locati
person disable keys;
Alter table... disable keys: Stop MySQL from updating non-unique indexes in the MyISAM table.
Activate a non-unique index
Alter table person enable keys;
Alter table... enable keys to recreate the lost index.
Set the default character set an
:
Copy Code code as follows:
ALTER TABLE person ADD UNIQUE name_unique_index (' name ');
A unique index was created for the column name, which is named Name_unique_index.
To add a normal index:
Copy Code code as follows:
ALTER TABLE person ADD INDEX birthday_index (' birthday ');
To delete an index:
Copy Code code as follows:
ALTER
recommended that you use a consistent convention, such as always creating databases and tables in lowercase letters.
Another way to avoid this problem is to start mysqld with the-o lower_case_table_names=1 parameter. By default, this option is 1 in Windows and 0 in Unix.
If Lower_case_table_names is 1, MySQL converts all table names to lowercase when they are stored and found. (Starting with
How do I create a memory table?Creating a memory table is very simple, just specify engine= MEMORY:
Copy Code code as follows:
CREATE TABLE ' tablename ' (' columnName ' varchar (256) not NUL) engine=memory DEFAULT charset=latin1 max_rows=100000000;
Attention:
When the data in the memory table
operations, such as drop table or TRUNCATE table. It is best suited to the case where the consolidated disk is used to store MySQL data because the system tablespace does not shrink, and all the databases are in one space instance. When Innodb_file_per_table=off, avoid importing large amounts of temporary data in space-constrained system tablespaces.The innodb_f
| 1 || Binary | Binary pseudo charset | binary | 1 || Geostd8 | GEOSTD8 Georgian | geostd8_general_ci | 1 || Cp932 | SJIS for Windows Japanese | cp932_japanese_ci | 2 || Eucjpms | UJIS for Windows Japanese | eucjpms_japanese_ci | 3 |+ ---------- + ----------------------------- + --------------------- + -------- +
The preceding MySQL character set command is applicable to Windows and Linux.
4. Modify the character set of tables and fields// Modify the
Some MySQL releases have changed the structure of the system table in the MySQL database and added new permissions or features. When you update to the new MySQL version, you should update the system tables at the same time to ensure that their structure is up-to-date. First, back up the
In Linux, the database name, table name, column name, And alias are case-sensitive:
1. The database name and table name are case sensitive;
2. Table aliases are case sensitive;
3. The column name and column alias are case-insensitive in all cases;
4. Variable names are case sensitive;
MySQL is cas
The test environment is win7, office 2010, and MySQL 5.5.42.
1: Create a test table with three fields, two of which are used for demonstration.
1 mysql> create table tt(a int(11) not null,b varchar(30),c varchar(30));
1 mysql> insert into TT values (1, 'beijing', 'peking
index that is stored in memory. However, if MySQL or the server restarts, the data in the table will be lost. Usage: such as the online statistics of the forum, such table data should be irrelevant, in a few simple fields, the data is not much, the number of records will not exceed 1000, but the operation is the most frequent ( The basic user each action to upda
When MySQL inserts Chinese into the table, it appears:incorrect string value error, because the character set does not support Chinese. The workaround is to change the character set to GBK, or UTF-8.First, modify the default character set of the database DEFAULT charcter SET character_name [COLLATE ... Example:ALTER TABLEdb_mysql DEFAULT charcter SET GBK notes:(Collate is a character set check, can
)The table created by default does not support Chinese characters, so you need to set the table encoding to UTF8:mysql> ALTER TABLE KEYCHAIN CONVERT to CHARACTER SET UTF8;Query OK, 1 row affected (0.02 sec)Records:1 duplicates:0 warnings:02.4.1 Insert to add columns (fields)
points:SELECT from WHERE the GROUP by has an ORDER by--mysql Order of execution when executing SQL statements:--from where select group by have order by--Analysis:Select JS as JS score from Examresult where JS score >70; ----Not successfulSelect JS as JS score from Examresult have JS score >90; ---success(8) LimitSELECT * from Examresult limit 1;SELECT * from Examresult limit 2,5;--skips the first two bars showing the next five recordsSELECT * from E
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.