All,
Is this possible to add a column that is a surrogate key to a view.
What about using the rownum as this surrogate key. any issues or problems to arise?
thanks,
Kat
Printable View
All,
Is this possible to add a column that is a surrogate key to a view.
What about using the rownum as this surrogate key. any issues or problems to arise?
thanks,
Kat
Row num is not a deterministic function. As in every time that you select from the query the row num value is different for every row. Given that every table should have a primary key, you should be able to find a value or set of values that are always unique. If not, then you need to think about the way in which your database was designed. If this is an aggregate query then you need to group by fewer columns.
Basically your asking the wrong question. The right question should be why can't I uniquely identify each row based on a unique set of values. :confused:
ok, thanks I understand what you are saying. I will look at the view again. thanks