MySQL Forums
Forum List  »  General

Re: SQL to display hourly count including zero
Posted by: alex erik
Date: April 02, 2017 04:30AM

Your Left Join ... On ... argument is missing the left portion of its argument. So effectively it's a Cross Join.

And, the hour value in a timestamp value ts is just substr(ts, 12, 2 ).

So try ...

...left join hours on substr(production_data.machine_start,12,2) = hours.idhours...

Options: ReplyQuote


Subject
Written By
Posted
Re: SQL to display hourly count including zero
April 02, 2017 04:30AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.