hi all,
I am new to this forum and I have an issue while migrating t-sql to pl-sql.
the Original transact sql is doing a select into. When I wrote the same in pl-sql it is throwing too many rows exception. The query is returning two rows. then I modified the query to restrict the rows returned using the condition rownum<=1. But oracle is returning by default the first row. Where as the transact is returning the last row. So, later the procedures are working on two different rows and my output was different. I found an option to have the same functionality implemented in pl-sql using a sub query. But is there any optimized way to handle this is my question. Also I cannot do an order by On a column as I don't know the clients business logic on which column the order by to be implemented. I tried using order by rownum and rownum<=1 By writing a sub query. But I was told that it would be a performance overhead. is there any optimized way to fetch the last row in oracle. Pls help
regards,
Sona