摘要: This version of MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery'的意思是,这版本的 MySQL 不支持使用 LIMIT 子句的 IN/ALL/ANY/SOME 子查询,即是支持非 IN/ALL/ANY/SOME 子查询的 LIMIT 子查询。 也就是说,这样的语句是不能正确执行的。select * from table where id in (select id from table limit 10)但是,只要你再来一层就行。。如:select * from table 阅读全文
posted @ 2013-09-19 12:11 bore3601 阅读(352) 评论(0) 推荐(0) 编辑
摘要: 1.输出数字为001,002... 阅读全文
posted @ 2013-09-13 10:20 bore3601 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 1.从文本中提取URL的正则表达式'/https?:\/\/[\w-.%#?\/\\\]+/i' 阅读全文
posted @ 2013-09-13 08:42 bore3601 阅读(989) 评论(0) 推荐(0) 编辑
摘要: 1.定时刷新2.页面载入后刷新 阅读全文
posted @ 2013-09-13 08:30 bore3601 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1. ALTER TABLE user ADD UNIQUE (username,userid) 对表user增加username和userid的唯一约束 阅读全文
posted @ 2013-05-20 09:37 bore3601 阅读(9400) 评论(0) 推荐(0) 编辑
摘要: 1.今天要做两个data.frame进行比较,比如 A <-data.frame(id=c(1:10)) id1 12 23 34 45 56 67 78 89 910 10B <-data.frame(id=c(1:5)) id1 12 23 34 45 5A$id[A$id %in% B$id] #找出A中与B相同的元素[1] 1 2 3 4 5A$id[!A$id %in% B$id] #找出A中与B不同的元素[1] 6 7 8 9 10 阅读全文
posted @ 2013-04-12 17:06 bore3601 阅读(1534) 评论(0) 推荐(1) 编辑
摘要: 最近用igraph包处理社交网络,有若干技巧。1.输出图中所有节点 V(g)$name g是相应的图2.根据节点degree输出节点 V(g)[degree(g)>3] 将图中degree大于3的节点输出 g是相应的图 阅读全文
posted @ 2013-04-10 21:29 bore3601 阅读(4436) 评论(1) 推荐(0) 编辑
摘要: 一个小例子:func <- function(n) { a <- matrix(rnorm(n*n), n, n) b <- matrix(rnorm(n*n), n, n) output <- list(a = a, b = b) return(output)}out <- func(5)a1 <- out$ab1 <- out$b 阅读全文
posted @ 2013-04-09 20:09 bore3601 阅读(1411) 评论(0) 推荐(0) 编辑
摘要: 1.今天发现数据库中数据有点问题,有些数据在获取的时候多了‘&nbsp’这样的字符。发现SQL有Replace这样的函数。 用法: update tablename set colname=replace(colname,'&nbsp',''); tablename 是表名; colname 是列名;将字符‘&nbsp’替换为NULL 阅读全文
posted @ 2013-04-09 19:55 bore3601 阅读(190) 评论(0) 推荐(0) 编辑
摘要: R语言中if else语句的编写格式因为R是解释语言,如果else单独起一行,无法解释执行。所以else不能单独一行,最好这样写:if(a) { print("hello")} else { print("Hi")} 阅读全文
posted @ 2012-12-14 11:44 bore3601 阅读(12866) 评论(0) 推荐(0) 编辑