Miraage
Miraage

Reputation: 3464

MySQL Left join ruins result

I have field date DATE in table A and field date INT in table B. I am trying to select all rows from table A where date between today and last day of month and JOIN table B by date (sure I do conversion), but in result I only have 1 result row.

I have created SQLFiddle with my data and query, I it may help..
http://sqlfiddle.com/#!2/e107d/1

Upvotes: 0

Views: 88

Answers (1)

Kickstart
Kickstart

Reputation: 21513

Posting as an answer rather than a comment

Issue appears to be that the query requires GROUP BY day being added before the HAVING clause

Upvotes: 2

Related Questions