一些mysql语句

by alpha 18. December 2007 21:42
SELECT `wp_comments`. * , `user2`. *
FROM `wp_comments` , `user2`
WHERE `user2`.`user_login` = `wp_comments`.`comment_author`
LIMIT 0 , 30

INSERT INTO `ilk830k`.`wp_comments2`
SELECT *
FROM `ilk830k`.`wp_comments` ;

INSERT INTO `ilk830k`.`wp_comments2`(comment_post_ID,comment_content,comment_author,comment_date,comment_date_gmt,comment_author_IP,comment_author_email,comment_author_url)
SELECT `wp_comments`. comment_post_ID ,`wp_comments`. comment_content,`wp_comments`. comment_author,`wp_comments`. comment_date,`wp_comments`. comment_date as comment_date_gmt ,`wp_comments`. comment_author_IP,`user2`.user_email as comment_author_email,`user2`.user_url as  comment_author_url
FROM `wp_comments` , `user2`
WHERE `user2`.`user_login` = `wp_comments`.`comment_author`
LIMIT 0 , 30


update `wp_comments2`,`blog_user` set `wp_comments2`.`user_id`=`blog_user`.`user_id` WHERE `blog_user`.`user_name`=`comment_author`

update `wp_comments`,`wp_users` set `wp_comments`.`user_id`=`wp_users`.`id` WHERE `wp_users`.`user_login`=`comment_author`


INSERT INTO `ilk830k`.`wp_posts`(ID,post_author,post_date,post_date_gmt,post_content,post_title,post_category,post_excerpt,comment_count)
SELECT log_id as ID ,log_authorID as post_author,log_postTime as post_date,log_postTime as post_date_gmt,log_content1 as post_content,log_title as post_title,log_catID as post_category,log_content0 as post_excerpt,log_commentCount as comment_count
FROM blog_article  

INSERT INTO wp_term_relationships (object_id,term_taxonomy_id)
select ID as object_id,post_category as term_taxonomy_id from wp_posts

update `wp_posts` set `post_content`=CONCAT(`post_excerpt`,'<!--more-->',`post_content`) where length(`post_excerpt`)>2

Tags: Views:1543

SqlServer

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen  浙ICP备09023819号  

关于作者

Alpha

1.男
2.已婚
3.网虫
4.宝宝叫yoyo

Calendar

<<  July 2010  >>
MondayTuesdayWednesdayThursdayFridaySaturdaySunday
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

View posts in large calendar

RecentComments

Comment RSS