2014-11-11 5 views
0

두 테이블을 결합하는 데 RSQLite를 사용하고 있습니다. 나는 한 걸음 한 걸음 씩 점검하지만 여전히 잘못 된 것이 무엇인지 파악하지 못했습니다. 게시 된 쿼리 테이블 H3K4me1_mesc_common에서문에서 오류가 발생했습니다 : 해당 열은 없지만 열이 있습니다.

ol5_H3K4me1_mesc_common<-dbGetQuery(con,"select* from H3K4me1_mesc where H3K4me1_mesc.V2=H3K4me1_mesc_common.V2 and H3K4me1_mesc.V3=H3K4me1_mesc_common.V3") 
Error in sqliteSendQuery(con, statement, bind.data) : 
    error in statement: no such column: H3K4me1_mesc_common.V2 
> dbListFields(con,"H3K4me1_mesc_common") 
[1] "V1" "V2" "V3" 
+1

표 별명 곳 아래처럼 보이도록 쿼리를 원'H3K4me1_mesc_common'은'from'에 있지 않습니다. –

답변

0

FROM 조항의 일부가 아닙니다 그래서 오류입니다 : 여기 내 스크립트입니다. 그 열은 쿼리와 관련이없는, 그래서 당신은 t1t2가 각각의 테이블

select t1.* from H3K4me1_mesc t1 
join H3K4me1_mesc_common t2 
on t1.V2 = t2.V2 
and t1.V3 = t2.V3