Tag: query
Advanced SQL and named scopes stack with ActiveRecord
Jan.24, 2010
If you ever work with rails application that is a little bit more complex then a simple CRUD you would know that some of the ActiveRecord magic doesn’t work for complex SQL queries. I am primary talking about named scopes stack feature.
(continue reading…)
1 Comment
:ActiveRecord, named_scope, query, rails, ruby, sql
more...
(continue reading…)
Double select from a single table in complex SQL query.
Jun.02, 2009
When I start learning SQL I have to write a lot of nested queries when working on complex select statements from a single table. Now, I feel more comfortable with it and show how to avoid nesting. There are cases when you have to compare one row of the table with all others to get the result:
Leave a Comment
:nesting, query, select, sql
more...
- Select next element to current by the value of some field
- Select records that are unique by some complex expression
- Select all records that have the same parameter as given record.