HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/gems/ruby-2.5.9/doc/activerecord-6.1.4.1/ri/ActiveRecord/Querying/count_by_sql-i.ri
U:RDoc::AnyMethod[iI"count_by_sql:ETI"(ActiveRecord::Querying#count_by_sql;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph;	[
I"dReturns the result of an SQL statement that should only include a COUNT(*) in the SELECT part. ;TI"cThe use of this method should be restricted to complicated SQL queries that can't be executed ;TI"cusing the ActiveRecord::Calculations class methods. Look into those before using this method, ;TI"]as it could lock you into a specific database engine or require a code change to switch ;TI"database engines.;To:RDoc::Markup::BlankLineo:RDoc::Markup::Verbatim;	[I"aProduct.count_by_sql "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id"
;TI"
# => 12
;T:@format0S:RDoc::Markup::Heading:
leveli	:	textI"Parameters;T@o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0;	[o;
;	[I"i+sql+ - An SQL statement which should return a count query from the database, see the example above.;T:
@fileI""lib/active_record/querying.rb;T:0@omit_headings_from_table_of_contents_below000[I"
(sql);T@ FI"
Querying;TcRDoc::NormalModule00