All pastes #634990 Raw Edit

Anonymous

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