Skip to content

Instantly share code, notes, and snippets.

@CerebralMastication
Created August 20, 2018 14:54
Show Gist options
  • Save CerebralMastication/29ce37e24ec27d772af19a9c3988446f to your computer and use it in GitHub Desktop.
Save CerebralMastication/29ce37e24ec27d772af19a9c3988446f to your computer and use it in GitHub Desktop.
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