随笔分类 -  sql

摘要:aggregate(x = xdata$species, by = list(xdata$id), FUN = paste, collapse = ",")aggregate(data = xdata, species ~ id, FUN = paste, collapse = ",") 阅读全文
posted @ 2017-10-09 21:52 Emily_zhu
摘要:MySQL的group_concat函数实现多条记录合并,但没有去重功能。 阅读全文
posted @ 2017-03-16 14:52 Emily_zhu 阅读(188) 评论(0) 推荐(0)
摘要:data: have <- data.frame(ID=paste0("id", c(101, 102, 102, 103, 103, 104, 105, 105)), info1=c("one", "twoA", "twoB", "threeA", "threeB", "four", "five" 阅读全文
posted @ 2017-03-06 12:16 Emily_zhu 阅读(1423) 评论(0) 推荐(0)
摘要:ORDER BY子句必须出现在SELECT中的最后一个子句。 在排序的列中NULL值被认为是最大的。 在SQL语句中给表达式定义别名是一个好习惯。 多列排序时不管升序还是降序,每个列需要单独设置 阅读全文
posted @ 2016-11-28 09:53 Emily_zhu 阅读(197) 评论(0) 推荐(0)