0

I would like to make the following statement:

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

This statement works with SQLite Manager but does not work in RSQLite.

Could you please help me?

Thank you very much :)

LyzandeR
  • 37,047
  • 12
  • 77
  • 87
dmautrinh
  • 1
  • 1

1 Answers1

2

To me, != works as it should. Here is an example:

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)
lukeA
  • 53,097
  • 5
  • 97
  • 100