MySQL Forums
Forum List  »  Newbie

Re: Subdivide data collected by day
Posted by: Peter Brawley
Date: November 23, 2019 11:16AM

It's a table, not a database.

> store in a second table all the days present
> in the original table, so that I can just "loop"

A procedural approach. SQL is a set-based language, you need to read a primer on sql queries.

If the table name is `tbl`, weather for a given day is ...

select time(datetime) as TimeOfDay, 'Weather 2019-11-23'
from tbl
Where date(datetime) = '2019-11-23'
order by TimeOfDay;

Options: ReplyQuote


Subject
Written By
Posted
Re: Subdivide data collected by day
November 23, 2019 11:16AM


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.