:
SELECT [sheet1$.col1], [sheet1$.col2], [sheet2$.col1]
FROM [sheet1$], [sheet2$]
WHERE [sheet1$.col1] = [sheet2$.col2]
Excel (sheet1 sheet2). 2 , (col1 col2 ).
:
> library(RODBC)
> conn <- odbcConnectExcel('c:/tmp/foo.xls')
> query <- "select [sheet1$.col1], [sheet1$.col2], [sheet2$.col1]
from [sheet1$], [sheet2$]
where [sheet1$.col1] = [sheet2$.col2];"
> result <- sqlQuery(conn, query)
> odbcClose(conn)
> result
col1 col2 col1.1
1 1 3 5
2 2 4 6
3 3 5 7
. . , .