Compatible grouped query for PostgreSQL and sqlite?
-
I'm making kind of "popular bookmarks" with RoR. I wrote query below. Bookmark.select("*, count('item_id') AS cnt").group("item_id").order("cnt DESC").limit(60) It works on local sqlite3 server but doesn't work on heroku postgreSQL environment. I heard group query doesn't have compatibility but don't know how to fix. any ideas?
-
Answer:
Using the same database technology in ideally the exact same version is preferable over testing that queries work the same in two databases. Getting Postgres to run locally is not that hard. If you are on a Mac, try Postgres.app [1], for other platforms see [2]. [1]: http://postgresapp.com/ [2]: https://devcenter.heroku.com/articles/local-postgresql
Thomas Klemm at Quora Visit the source
Related Q & A:
- Do I have to create attributes for creating magento grouped products with more columns?Best solution by Magento
- How to convert sql query to Hibernate Criteria query?Best solution by Stack Overflow
- How to convert my SQL query to MS Access query?Best solution by Stack Overflow
- How can we use MongoDb with postgresql?Best solution by Stack Overflow
- How to convert SQL query to LINQ query?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.