Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
long query in r
query <- "SELECT uid,
timestamp,
sensor_1
FROM database_name.long_table_name_here
WHERE ( ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1230'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' )
OR ( uid = 'abxyz1236'
AND filter_id = '1'
AND timestamp >= '2018-07-23'
AND timestamp <= '2018-08-02' ) ) "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment