Write a SQL query to find the second-highest transaction value from a table, then modify it to handle duplicate values.