在sqlserver 中的语句:
if (not exists (select null from tb where ExpLevel=0))
select 0 as Experience
else
select Experience from tb where ExpLevel=0
在mysql中要怎么写呢??
求帮助!
if (not exists (select null from tb where ExpLevel=0))
select 0 as Experience
else
select Experience from tb where ExpLevel=0
在mysql中要怎么写呢??
求帮助!
CREATE PROCEDURE ff()
BEGIN
IF (NOT EXISTS (SELECT NULL FROM tb WHERE ExpLevel=0)) THEN
SELECT 0 AS Experience;
ELSE
SELECT Experience FROM tb WHERE ExpLevel=0;
END IF;
END$$
DELIMITER ;