Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
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