mysql

1.插入多条数据:

INSERT INTO think_user (user,email,date)
SELECT '雪莲花开' ,'xuelianflower@qq.com',NOW()
UNION ALL
SELECT '青春如此浪荡' ,'youngth@yahu.com',NOW()
UNION ALL
SELECT '暖心向阳i' ,'warnheart@sohu.com',NOW()
UNION ALL
SELECT '如果没有明天' ,'tommorrow@hotmail.com',NOW()
UNION ALL
SELECT '残阳照、墨痕' ,'canyang@gmail.com',NOW()
UNION ALL
SELECT '久伴成了酒伴' ,'wine@163.com',NOW()
UNION ALL
SELECT '萌神无敌i' ,'mengshen@126.com',NOW();

 

 批量插入到数据库:

INSERT INTO sdb_b2c_member_comments ( type_id, object_type, author,comment ) VALUES 
( 3184 , 'discuss' , 'member_test9' , 'discuss test 9' ),
( 3184 , 'discuss' , 'member_test10' , 'discuss test 10' ),
( 3184 , 'discuss' , 'member_test11' , 'discuss test 11' ),
( 3184 , 'discuss' , 'member_test12' , 'discuss test 12' ),
( 3184 , 'discuss' , 'member_test13' , 'discuss test 13' ),
( 3184 , 'discuss' , 'member_test14' , 'discuss test 14' ),
( 3184 , 'discuss' , 'member_test15' , 'discuss test 15' );

 

2.插入单条数据:

INSERT INTO users (username,sex,birth) VALUES ('Lee','x',NOW());

posted @ 2015-10-01 10:47  miyaye  阅读(150)  评论(0编辑  收藏  举报