DELIMITER $$
DROP FUNCTION IF EXISTS `tim_to_min`$$
CREATE FUNCTION tim_to_min(f_time VARCHAR(30))
RETURNS VARCHAR(255)
DETERMINISTIC
BEGIN
DECLARE h VARCHAR(30);
DECLARE m VARCHAR(30);
DECLARE s VARCHAR(30);
SET h=SUBSTRING_INDEX(f_time,':',1);
SET m = REPLACE(SUBSTRING(SUBSTRING_INDEX(f_time,':',2),
LENGTH(SUBSTRING_INDEX(f_time,':',1))+1),':','');
SET s = REPLACE(SUBSTRING(SUBSTRING_INDEX(f_time,':',3),
LENGTH(SUBSTRING_INDEX(f_time,':',2))+1),':','');
RETURN ROUND((h*60)+m+(s/60),0);
END$$
DELIMITER ;
--> use this stored function in mysql
then call the function..
SELECT tim_To_min('8: 2:9'); /*call function tim_to_min */