title: How to set next null value with first value using select or view function in php mysql?
body: <p>Please help me how to solve this...I'm newbie for this... </p>
  
  <pre><code>SELECT idt, date_played, date_end, duration FROM `v_currentshow`
  </code></pre>
  
  <p>where date_played, date_end, and duration fields are DATETIME</p>
  
  <pre>
  idt    date_played          date_end               duration
  1      2013-03-13 22:33:48  2013-03-13 21:58:20    00:35:28
  2      NULL                 NULL                   00:02:11
  3      NULL                 NULL                   00:00:32
  4      NULL                 NULL                   00:36:42
  5      NULL                 NULL                   00:01:30
  6      NULL                 NULL                   00:25:12
  7      NULL                 NULL                   00:01:37
  .
  .
  .
  n      NULL                 NULL                   00:02:32
  </pre>
  
  <p>The questions are..</p>
  
  <ol>
  <li>How can we set the next date_played null value like in idt=2 and another idt, start with date_end value in idt=1 and counting so on through entire table just using SELECT and make it on VIEW...?</li>
  <li>How can we set the next date_end null value like in idt=2 and another idt, with date_played that already set like in the question no.1, just using SELECT and make it on VIEW?</li>
  </ol>
  
  <p>please help...Thanks</p>
  
  <p>the sample for the result like the following table...if it's not possible...how to get it with update?</p>
  
  <pre>
  idt    date_played          date_end               duration
  1      2013-03-13 22:33:48  2013-03-13 21:58:20    00:35:28
  2      2013-03-13 21:58:20  2013-03-13 22:00:31    00:02:11
  3      2013-03-13 22:00:31  2013-03-13 22:01:03    00:00:32
  4      2013-03-13 22:01:03  2013-03-13 22:37:45    00:36:42
  5      2013-03-13 22:37:45  2013-03-13 22:39:15    00:01:30
  6      2013-03-13 22:39:15  2013-03-13 23:04:37    00:25:12
  7      2013-03-13 23:04:37  2013-03-13 23:06:14    00:01:37
  .
  .
  .
  TILL THE END 
  </pre>
  
  <p>Thank You...</p>