As far as I can see, it is not possible to order by a factor in sqldf:
levels( iris$Species ) <- c("virginica", "versicolor", "setosa")
levels(iris$Species)
> sqldf(' select distinct iris.[Species] from iris order by iris.[Species] ' )
Species
1 setosa
2 versicolor
3 virginica
The output above shows that sqldf() interprets Species as a character, and orders alphabetically, not by factor.
What is an easy and safe way to work around this?