- SELECT
- Order By Rand
- Concat Fields
- Between
- Regexp
- If Null
- Union
- Replace
- Using Syntax
- Substring
- DATE
- Get Date
- Date Format
- Today
- Month Day
- Date Parts
- ADMINISTRATION
- Foreign Key
- Foreign Key Disable
- Innodb
- Create Database
- Create Table
- Add Column
- Add Index
- Data Type
-
Primary Key
- Errors
- Indexes
- Mysqldump
- Table Definition
MYSQL PAGES - LEVEL 3
Ingnore primary key
CREATE TABLE file_names (
id int(11) NOT NULL auto_increment,
file_name text NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY file_name (file_name(200))
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
Insert query
INSERT IGNORE INTO file_names (id , file_name)
VALUES (NULL , 'a'), (NULL , 'a');
The table now contains one row with a filename of 'a'
Questions and answers:
Clink on Option to Answer
1. Insert and ignore primary key ...
- a) INSERT IGNORE INTO mytable ...
- b) INSERT INTO mytable ... IGNORE KEY