게시판을 만들고있는 초보입니다.ㅜ
테이블은 disorders_info이고요
컬럼 접수일 register_day 2017-03-29 11:00
컬럼 완료일 restoration_day 2017-03-29 12:00
컬럼 소요시간 restoration_day_time 00일01시00분 or 00:01:00
일 시 분까지 확인할 수 있는 방법좀말려주세요ㅜ
WITH disorders_info AS ( SELECT '2017-03-29 11:00' register_day , '2017-03-30 12:15' restoration_day ) SELECT register_day , restoration_day , CONCAT( RIGHT(CONCAT('0', dd ), 2), ':' , RIGHT(CONCAT('0', hh%24), 2), ':' , RIGHT(CONCAT('0', mi%60), 2) ) AS restoration_day_time FROM (SELECT register_day , restoration_day , DATEDIFF(day , register_day, restoration_day) dd , DATEDIFF(hour , register_day, restoration_day) hh , DATEDIFF(minute, register_day, restoration_day) mi FROM disorders_info ) a ;