-
I need to add an surrogate key to a 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
Last edited by katora; 11-29-2012 at 04:08 PM.
-
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.
-
ok, thanks I understand what you are saying. I will look at the view again. thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|