包的加载
library(sqldf)
library(gsubfn)
library(proto)
library(RSQLite)
读取数据存储表
setwd("C:\\Users\\jhinno\\Desktop\\SQL数据表")
data1 <- read.csv("dbo.Fabric.csv")
head(data1)
data2 <- read.csv("dbo.Yarn.csv")
head(data2)
data3 <- read.csv("dbo.YarnCard.csv")
head(data3)
SQl语句使用
sq1 <- sqldf(“select * from data1”)
head(sq1)
SQL的嵌套查询
sq1 <- sqldf("select t1.sMaterialNo,t1.nQty,t3.tPlanTime from data1 t1,data2 t2,data3 t3")
|
请发表评论