Created
December 5, 2017 17:21
-
-
Save dnd/503958d156ff763eeaa3b4036231e2c3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (3,'bob smith','2017-11-26'); | |
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (4,'bob jones','2017-11-26'); | |
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (5,'bob ames','2017-11-26'); | |
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (6,'adam','2017-11-27'); | |
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (7,'larry','2017-11-27'); | |
INSERT INTO `new_table` (`id`,`name`,`created_at`) VALUES (8,'hank','2017-11-29'); |
This file contains hidden or 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
SELECT * | |
FROM new_table | |
where created_at >= '2017-11-26' | |
and not (created_at <= '2017-11-26' and name <= 'bob ames') | |
order by created_at, name; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GraphQL-Pro doesn't know that values in the table are unique together. (I can't think of how it could, unless there was a compound unique key in the database.) So, it will add
.order(primary_key => :asc)
to the relation.Assuming you resume pagination after "bob ames", the resulting query will look like this: