結果 : sql query to return true or false based on condition