-1
`ID`,`NAMES`,   `TIMESTAMP`
'3', 'Sharon',  '2020-02-17 21:11:12'
'4', 'RALPH',   '2020-02-18 01:50:19'

Above is an extraction from my table.I would want to find time difference between the two timestamps(i.e for ID=3 and ID=4). Also i would like to create a column for the time difference.Please someone help Thanks

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • 1
    Please show us the result that you expect. – GMB Feb 18 '20 at 09:56
  • The problem is not about timestamp (date & time functions should solve it) but in applying _any_ operation _between_ two rows. Also a newly created column will occur on _every_ row: you need to specify which value you want on each row. – AntoineL Feb 18 '20 at 10:40

1 Answers1

0

You can use TIMESTAMPDIFF() function

  • I see you do not yet have **50 reps**, but this is really just a comment. This type of answer attracts downvotes or gets flagged ___I did not DV___ and if that happens you will loose rep points and take longer to get to the 50 reps you need to comment on any question. Until then, stick to questions that are well asked and therefore easily answered without needing clarification. http://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead – RiggsFolly Feb 18 '20 at 11:39
  • Thanks, RiggsFolly for this I will be careful – Mikhil Wankhede Feb 18 '20 at 12:54
  • Thanks,Nick I will try to avoid such kind of mistake – Mikhil Wankhede Feb 18 '20 at 17:26