小编Cha*_*any的帖子

在mysql中的一个选择案例中的情况

我厌倦了尝试连接到MSSQL,所以我转而使用mysql.这是缓慢的进展.这是我目前的傻瓜:mssql:

create function W(m varchar(255)) returns int begin

declare @e int
set @e = (select COUNT(N) from P where N = m)

declare @t int
set @t = dbo.C(m)

return case @t 
when 0 then -1 
when 1 then
    case @e when 0 then -1 else 1 end
when 2 then
    case @e when 1 then -1 when 2 then 0 when 3 then 0 when 4 then 1 end
when 3 then 
    case @e when 1 then -1 when …
Run Code Online (Sandbox Code Playgroud)

mysql nested case

11
推荐指数
1
解决办法
3万
查看次数

标签 统计

case ×1

mysql ×1

nested ×1