SELECT p.pid, p.filename, AVG(v.vote) as avgv, COUNT(v.vote) as avgc FROM wp_ngg_pictures p LEFT JOIN wp_nggv_votes v ON (p.pid = v.pid) ...
PHP SQL Query Optimization
by https://www.google.com/accounts/o8/id?id=AItOawmyRuor7Z0aC0QytK3lMrz5h5jH73-dECw,
December 13, 2011 21:03,
3 refactorings, tagged with speed, sql, optimization
select distinct(user_id) from facebook_post_comments where page_id =some_page_id and user_id in (select distinct(user_id) from facebook_post_comments where page_id = some_other_page_id)
Python MySQL O(n^2)
by https://www.google.com/accounts/o8/id?id=AItOawlXyCfS3cPSoWLo635rrzVPpmDr0-DUdus,
October 20, 2011 12:54,
2 refactorings, tagged with sql, mysql, short clean ruby
Hello! Trying to run this q...
procedure TfrmOperationDetail.SaveOperationInfo; var s: string; ...
Delphi What has been called a &quo...
by blackbird-crow-raven.myopenid.com,
December 30, 2010 16:51,
1 refactoring, tagged with sql, ado, delphi, steaming pile of horse dung
I am refactoring a large ap...
def self.find_for(options = {})
scope = scoped
scope = scope.where(:hook => options[:hook].to_s) if options[:hook]
...
Ruby ActiveRecord query construc...
by https://www.google.com/accounts/o8/id?id=AItOawmLF7gR3CIpZoZXbwO7fiD2QWYltD3lwpM,
December 23, 2010 15:27,
1 refactoring, tagged with rails, sql, activerecord, rails3, arel
Rails 3.0.3
This method ...
# link_categories has_many links create_table "link_categories", :force => true do |t| t.string "name" ...
Ruby Find records according to r...
by https://www.google.com/accounts/o8/id?id=AItOawl_CInyr4p6Fw9fCXT3DYEGIiMyGOQDomw,
August 02, 2010 18:43,
1 refactoring, tagged with rails, sql, ruby, activerecord
I have a method (LinkCatego...
// Stored procedure: IsItUnique CREATE PROCEDURE [dbo].[IsItUnique] ...
C# SQL Server - Similarity Score
First of all I apologize fo...
Clip.find_by_sql(["select * from clips where not exists
(select 'clip_id' from histories where histories.clip_id = clips.id
and histories.user_id = ?) ORDER BY clips.created_at DESC LIMIT 20", user.id])
Ruby ActiveRecord find_by_sql
How can I turn this into so...
class Item < ActiveRecord::Base ALL_VOTES = "all_votes" SCORE = "score" ...
Ruby Complex query in Ruby on Ra...
I have a method called rank...
select rrr.account_number,
summa,
to_char(to_date('19570101', 'YYYYMMDD') + max(rrr.lst_pay_dn),
...
PHP Can I do it without accessi...
Actually it's not PHP. And ...
#players = select distinct(player) from actions;
players = repository(:default).adapter.query('select distinct(player) from actions')
...
Ruby getting 20-100+ sums in one go
by feydr.myopenid.com,
February 10, 2009 19:13,
2 refactorings, tagged with sql, ruby, iteratate, sum
I have an actions table tha...
<?php $flacpath = '/bin/flac'; ...
PHP FLAC -> Multiple File Ty...
by wegosublime,
October 31, 2007 17:33,
5 refactorings, tagged with sql, cron, mp3, flac, ogg, music, record company, shell, command line
This is part of a larger pr...
This SQL query is currently...