It's a good idea to use the merge storage engine middleware to implement MySQL sub-table.
Can look at this blog written very clearly--http://www.cnblogs.com/xbq8080/p/6628034.html
In addition, the use of triggers is as follows:
1 ## MySQL Trigger2 3 T1 Table Insert data also update t2 table4 5```MySQL6(First \d//is to modify the delimiter shortcut, with//concluding sentence, do not have to change back \d, so you can change back with a semicolon '; ' concluding sentence
7 #creating a Write trigger8Create trigger T1 before insert on T1 for eachRow9 beginTenINSERT into T2 (name) VALUES (New.name); One End//
A #Create an UPDATE trigger -Create trigger t2 before update on T1 for eachRow --begin the-Update T2 Set name=New. name where Name=old.name; --End //
- #create a trigger for a delete -Create trigger T3 before delete on T1 for eachRow +-begin ---delete from T2 where name=old.name; +-End // AShow triggers;#Show all the triggers atDrop trigger T3;#Delete a trigger ------------------ - - trigger only supports insert update delete - Syntax: -Create TRIGGER < Trigger name >#name the trigger yourself in{before | after}#the time of the trigger -On TableName#Table name to for eachRow#the interval of the trigger is executed once for each row, not once for the table + - If you want to create a permission that is large enough to root the----------- *```
Implementing MySQL sub-table with merge storage engine middleware