2
當我以下查詢MySQL查詢分配錯誤
Select
case
when (@nume=Start_Date) then null
when (@nume!=Start_Date) then @num
End,
case
when (@nume=Start_Date and @nume:=End_Date) then null
when (@nume!=Start_Date) then @nume
End,
case
when (@nume!=Start_Date and @nume:=End_Date and @num:=Start_Date) then @nume
End
from P,(Select @num:=(Select Start_Date from P order by Start_Date desc Limit 1),@nume:=(Select End_Date from P order by Start_Date desc Limit 1)) as A
;
在下一回合它分配整數1個值@nume,而不是作爲日期它應該。