Note that there are some explanatory texts on larger screens.

plurals
  1. POCount recurring records on data base every 30 minutes interval
    primarykey
    data
    text
    <p>I need some help on the below</p> <p>i have the table <strong>"Data"</strong> getting data stored on it like the below</p> <pre><code>+------------+----------+----------- | regdate | regtime | items +------------+----------+----------- | 2013-03-02 | 09:12:03 | item1 | 2013-03-02 | 10:12:05 | item1 | 2013-03-02 | 15:12:07 | item2 | 2013-03-02 | 20:12:09 | item3 | 2013-03-02 | 21:12:11 | item4 | 2013-03-02 | 22:12:14 | item3 </code></pre> <p>and so on for <strong>10 items</strong> can go to the table at different times during the day from <strong>09:00 till 23:00</strong> </p> <p>and i have another table <strong>"ItemsPerInterval"</strong> like the below</p> <pre><code>+------------+-------------+-------------+-------------+-------------+ | regdate | reginterval | item1 | item2 | item3 | +------------+-------------+-------------+-------------+-------------+ | 2013-03-01 | 09:00:00 | 0 | 0 | 0 | +------------+-------------+-------------+-------------+-------------+ </code></pre> <p>and so on where the interval is increasing on <strong>30 minutes</strong> basis like 09:00 , 09:30 , 10:00, 10:30 ... till 23:00</p> <hr> <p>What i want to do is to insert data on the table <strong>ItemsPerInterval</strong> to include the recurring count for the items on the table <strong>"Data"</strong> (<em>item1, item2 ,item3 ,.... item10</em>) and store them upon interval basis (<em>09:00:00, 09:30:00, 10:00:00, 10:30:00, .... 23:00:00</em>) so that each interval - for example - <strong>09:00:00</strong> will have the recurring count for all items that has been registered on the <strong>Data</strong> table from <strong>09:00:00 till 09:29:59</strong> and so one for the rest of intervals up till 23:00:00</p> <p>EDIT **1</p> <p>so eventually all below intervals must be registered on the ItemsPerInterval table and hold the count for each item of the 10 items that has been reported with in the interval time window</p> <pre><code>09:00:00 09:30:00 10:00:00 10:30:00 11:00:00 11:30:00 12:00:00 12:30:00 13:00:00 13:30:00 and so on ..... . . . 22:00:00 22:30:00 23:00:00 </code></pre> <p>/EDIT **1</p> <p>i did some readings about routines / procedures but i don't know the difference and don't know how to use it to implement the above.</p> <p>i am using Software: MySQL Software version: 5.5.24 with PHP.</p> <p>Appreciate your support</p> <p>Thank you</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload