From 9fcf2b1a8e2b6a4098a4914e0703905a07eaa192 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Mon, 13 Jul 2015 22:27:58 -0500 Subject: [PATCH] Add a little more discussion at the end. --- rails/select-value-for-sql-counts.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rails/select-value-for-sql-counts.md b/rails/select-value-for-sql-counts.md index 22eb325..f94e54d 100644 --- a/rails/select-value-for-sql-counts.md +++ b/rails/select-value-for-sql-counts.md @@ -12,3 +12,7 @@ of _whatever_. (0.6ms) select count(*) from posts where published_at is not null => 42 ``` + +Writing raw SQL for a simple query like this hardly seems like a win. +However when a count query starts to involve joins or other fanciness, I +find it much clearer to reason about the raw SQL.