All pastes #634998 Raw Edit

Anonymous

public sql v1 · immutable
#634998 ·published 2007-07-26 19:35 UTC
rendered paste body
DELIMITER //CREATE procedure min_frm_friends(IN sdate DATE, IN edate DATE) BEGIN          IF char_length(sdate) < 1 THEN SET sdate = 20070101;          end if;          if char_length(edate) < 1 then set edate = 20200101;          end if;          SELECT MAX(date),time,Personal.pc.firstname,Personal.pc.lastname,number,count(minutes) AS minutes              FROM phonelog,Personal.pc              WHERE phonelog.number IN(Personal.pc.businessphone,Personal.pc.mobilephone,Personal.pc.homephone)                  AND sdate < date and edate > date              GROUP BY firstname ORDER BY minutes; END//DELIMITER ;