Adsense
Popular Posts
- Code update from PHP 7.4 to PHP 8.1 - PhpSpreadsheet
- MySQL workbench -"Could not decrypt password cache"
- Code update from PHP 7.4 to PHP 8.1 - Worksheet/Iterator.php
- Rendering HTML tags inside textarea
- axios handle blob type data
- Unix Utils and wget in Windows
- increase mysql query speed
- Setup vi syntax for PHP
- Get WAMP running on EC2
- add comment to table columns in phpMyAdmin
Wednesday, August 20, 2014
Copy MySQL table and ignore error, rename table
Supposed we have courses_offered table copied from courses_offered_temp:
CREATE TABLE courses_offered LIKE courses_offered_temp;
I already enter some data in courses_offered, now I want to copy data from courses_offered_temp.
As some of them may repeat, I need to ignore the error to continue:
INSERT IGNORE INTO `courses_offered` SELECT * FROM `courses_offered_temp` ;
INSERT IGNORE is used here.
Rename MySQl table `course_tutorial_schedule` TO `course_tutorial_schedule_old`:
RENAME TABLE `course_tutorial_schedule` TO `course_tutorial_schedule_old`;
Labels:
MySQL
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment