0

我想发表以下声明:

SELECT fieldA, fieldB 
FROM tableA 
WHERE fielb != 'cond' GROUP BY fieldA.

此语句适用于SQLite Manager,但不适用于RSQLite

请你帮助我好吗?

非常感谢 :)

4

1 回答 1

2

对我来说,!=工作正常。这是一个例子:

data(USArrests)
library(RSQLite)
m <- dbDriver("SQLite")
tfile <- tempfile()
con <- dbConnect(m, dbname = tfile)
dbWriteTable(con, "USArrests", USArrests)
rs <- dbSendQuery(con, "select * from USArrests where row_names != 'Alaska'")
d <- fetch(rs, n = -1)      # extract all remaining data
setdiff(row.names(USArrests), d$row_names)
# [1] "Alaska"

dbHasCompleted(rs)
dbClearResult(rs)
dbListTables(con)
dbDisconnect(con)
file.remove(tfile)
于 2015-01-04T14:30:48.307 回答