SQL文を使って件数を取得
説明
SQL文を使って件数を取得
使い方
count_by_sql(SQL文)
例
Product.count_by_sql "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id"
# 12
SQL文を使って件数を取得
count_by_sql(SQL文)
Product.count_by_sql "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id"
# 12