0

我正在尝试使用这样的程序:

DELIMITER $$

CREATE
    /*[DEFINER = { user | CURRENT_USER }]*/
    PROCEDURE `godating`.`realnames`(OUT rnames VARCHAR)
    /*LANGUAGE SQL
    | [NOT] DETERMINISTIC
    | { CONTAINS SQL | NO SQL | READS SQL DATA | MODIFIES SQL DATA }
    | SQL SECURITY { DEFINER | INVOKER }
    | COMMENT 'string'*/
    BEGIN
    SELECT username INTO rnames FROM users GROUP BY username HAVING COUNT(*)>3
    END$$

DELIMITER ;

我想在 rnames 输出中必须有几个用户名值。我怎样才能改进我的程序来实现这个目标?

4

1 回答 1

0
DELIMITER $$
CREATE    PROCEDURE `godating`.`realnames`(In rnames varchar)  
    BEGIN
    SELECT username FROM licenses GROUP BY licenses_key having count(*)>0;
    END//

DELIMITER ;
===================
This procedure call like mysql query usind "call sp_name(rnames_values)".
于 2012-11-03T12:43:08.347 回答