Skip to content

Instantly share code, notes, and snippets.

@toyeiei
Last active February 5, 2019 09:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toyeiei/9c8c5807718982b0a2920c94475c4091 to your computer and use it in GitHub Desktop.
Save toyeiei/9c8c5807718982b0a2920c94475c4091 to your computer and use it in GitHub Desktop.
# filter only cars with hp <= 100
sqldf("SELECT * FROM mtcars WHERE hp <= 100;")
# filter more than one conditions with AND
sqldf("SELECT * FROM mtcars WHERE hp <= 100 AND am = 1;")
# filter more than one condition with OR
sqldf("SELECT * FROM mtcars WHERE hp <= 100 OR gear = 4;")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment