1
有人可以幫助在mysql中獲得以下僞代碼嗎?在IF語句中產生的選擇都返回相同的列(4)和多行(未知),所以這不是我真正面臨的問題。如何在Mysql中獲得以下結構?僞代碼結構到Mysql?
//parameters
@p1;
@p2;
@v1;
@v2;
//vars
@t1= 15000;
@t2 = 15000;
//calculated vars
@overlap1 = (@p1 + @v1) > @t1; //boolean
@overlap2 = (@p2 + @v2) > @t2; //boolean
@overlap = @overlap1 OR @overlap2; //boolean
If NOT @overlap Then //no overlap
CUSTOM SELECT QUERIES (UNION etc..)
ElseIf @overlap1 AND @overlap2 //both overlaps true
CUSTOM SELECT QUERIES (UNION etc..)
ElseIf @overlap1 //only @overlap1
CUSTOM SELECT QUERIES (UNION etc..)
Else //only @overlap2
CUSTOM SELECT QUERIES (UNION etc..)
End If