Created
April 5, 2013 02:17
-
-
Save jgautsch/5316097 to your computer and use it in GitHub Desktop.
Query fiddling
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
1.9.3-p374 :015 > @books = @books.where(['substr(title,1,1) in ?', ('A'..'T').to_a]) | |
Book Load (41.2ms) SELECT "books".* FROM "books" WHERE (substr(title,1,1) in 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T') | |
SQLite3::SQLException: near ",": syntax error: SELECT "books".* FROM "books" WHERE (substr(title,1,1) in 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T') | |
ActiveRecord::StatementInvalid: SQLite3::SQLException: near ",": syntax error: SELECT "books".* FROM "books" WHERE (substr(title,1,1) in 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment