mysql列表條件查詢,workbench如何定義函數functions?
CREATE FUNCTION 函數名稱(參數列表) RETURNS 返回值類型 函數體 如: CREATE FUNCTION IF EXIST deleteById(uid SMALLINT UNSIGNED) RETURNS VARCHAR(20) BEGIN DELETE FROM son WHERE id = uid; RETURN (SELECT COUNT(id) FROM son); END 調用如: select 函數名(參數列表);