Skip to content
Browse files

for our crazy SQL, mysql wants table aliases for no apparent reason

  • Loading branch information...
1 parent 9cf1be9 commit 0e0b0a1b2ab7c21740ec237db72a8b01eb1b2160 @jrochkind committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/controllers/report_controller.rb
View
4 app/controllers/report_controller.rb
@@ -47,7 +47,7 @@ def fetch_stats
(case when option_a = choice then 1 else 0 end) as win,
(case when choice is NULL then 1 else 0 end) as tie,
(case when option_b = choice then 1 else 0 end) AS loss
- FROM selections
+ FROM selections as opt_as
UNION ALL
@@ -55,7 +55,7 @@ def fetch_stats
(case when option_b = choice then 1 else 0 end) as win,
(case when choice is NULL then 1 else 0 end) as tie,
(case when option_a = choice then 1 else 0 end) AS loss
- FROM selections
+ FROM selections as opt_bs
)

0 comments on commit 0e0b0a1

Please sign in to comment.
Something went wrong with that request. Please try again.