All pastes #634979 Raw Edit

Anonymous

public sql v1 · immutable
#634979 ·published 2007-07-26 19:26 UTC
rendered paste body
DELIMITER //CREATE procedure min_frm_friends (IN sdate DATE, IN edate DATE) BEGIN          IF sdate is NULL THEN SET sdate := 20070101;end if;if edate is null 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 ;