結果 : sql set variable value based on condition