File: //usr/local/rvm/gems/ruby-2.7.4/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::BlankLine o: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