Skip to content
Advertisement

How to split datetime 1 row into 2 or more rows based duration-mysql

How to split 1 row of datetime record into multiple rows by splitting duration based on datetime for every hour

Input:

Want to cut every hour by exact time by dividing duration

Output:

Advertisement

Answer

You should try this query

Here i have assumed that login and logout time have same date. it will give difference in minutes.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement