結果 : sql select nested if statement