Last active
March 2, 2020 20:36
-
-
Save mtellezj/cf53b021026572a851fb5838cdf86726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* MySql database | |
:PROPERTIES: | |
:header-args:sql: :engine mysql | |
:header-args:sql+: :cmdline "my_db -u john_doe -h 127.0.0.1" | |
:header-args:sql+: :var start_date="2019-02-27" | |
:header-args:sql+: :var end_date="2020-02-29" | |
:END: | |
** Get all clients | |
Press C-c C-c inside next block to query the database. | |
#+begin_src sql :results value raw org | |
SELECT * | |
FROM clients | |
WHERE last_modified BETWEEN "$start_date" AND "$end_date"; | |
#+end_src | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment