如何在 library(dplyr)
library(zoo)
DF = structure(list(Date = c("Jan-13", "Jan-13", "Jan-13", "Jan-13", "Jan-13", "Jul-14", "Jul-14", "Oct-16"), Price = c(100L, 200L, 300L, 1000L, 400L, 150L, 50L, 600L), Average.by.Date = c(400L, 400L, 400L, 400L, 400L, 100L, 100L, 600L), Moving_Average_Size_2 = c(NA, NA, NA, NA, NA, 250L, 250L, 350L)), .Names = c("Date", "Price", "Average.by.Date", "Moving_Average_Size_2"), class = "data.frame", row.names = c(NA,
-8L))
中实施Left
或right outer join
。一个简单的例子是有帮助的。
答案 0 :(得分:0)
为此,您应该使用leftJoin
方法。
E.g:
queryUtil
.createJpaQuery()
.from(t1)
.leftJoin(t1.t2, t2)
.fetchJoin()
.where(t2.a.eq(t1.t2.a))
.fetchAll()