mysql query help

hello all

i have 2 columns every column in the following format

column1
2011-04-01 11:39:54

column2
2019-02-03 00:00:00

i want get difference between above data as following
2 days 11:39

how to do so ?

i tried many functions but nothing works
please advice what is the query doing that ?

What have you tried?

i have tried timediff() , datediff(), to_days(), timestampdiff()
all doesnt show what i want , i wand the difference how many days and hours:min

so i can update another column with these values

---------- Post updated at 02:38 PM ---------- Previous update was at 02:29 PM ----------

i have tried timediff() , datediff(), to_days(), timestampdiff()
all doesnt show what i want , i wand the difference how many days and hours:min

so i can update another column with these values

I suspect you're going to have to do it in bits, subtracting it and getting the parts you want piecemeal and piecing them together with concat.

in excel its very easy :)) i wonder why mysql dont do same
=TEXT(D2-C2,"d - h:mm")

can you give me example of such query ?

Don't have a MySQL handy, but try something like this:

DATE_FORMAT(TIMESTAMPDIFF(MINUTES, column2, column1), '%d days %H:%i')

i have tried above formula

the output is all like this
00 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:0000 days 00:00