Created
April 27, 2015 10:26
-
-
Save benmmurphy/da38a21dd33a18527f49 to your computer and use it in GitHub Desktop.
Redshift Fun
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
logs=# create table timestamp_test (a timestamp, b timestamp); | |
CREATE TABLE | |
logs=# insert into timestamp_test(a,b) values('2015-04-25 06:29:40', '2015-04-25 06:35:36'); | |
INSERT 0 1 | |
logs=# select b-a from timestamp_test where b-a > 3000; | |
?column? | |
----------- | |
356000000 | |
(1 row) | |
logs=# select b-a from timestamp_test where b-a > 6000; | |
?column? | |
---------- | |
(0 rows) | |
logs=# insert into timestamp_test(a,b) values('2015-04-25 06:13:14', '2015-04-25 06:13:19'); | |
INSERT 0 1 | |
logs=# insert into timestamp_test(a,b) values('2015-04-25 06:13:14', '2015-04-25 06:13:19'); | |
INSERT 0 1 | |
logs=# select b-a from timestamp_test where b-a > 3000; | |
?column? | |
----------- | |
356000000 | |
5000000 | |
(2 rows) | |
logs=# select b-a from timestamp_test where b-a > 5000; | |
?column? | |
---------- | |
5000000 | |
(1 row) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment