Q: Order SQL database using RSQLlite and DBI I would like to order a SQL database by rowname using R. I am able to fetch the ordered results:
library(RSQLite)
library(DBI)

con <- dbConnect(RSQLite::SQLite(), dbname = ":memory:")

dbWriteTable(con, "cars", mtcars, temporary = TRUE, overwrite = FALSE, row.names = FALSE)
dbReadTable(con, "cars")

res <- dbSendQuery(con, 'SELECT * FROM cars ORDER BY rowname ASC')
dbFetch(res)

but I would like to order the SQL database itself. If I try the below code nothing happens:
dbExecute(con, 'SELECT * FROM cars ORDER BY rowname ASC')
dbReadTable(con, "cars") 

