简体   繁体   中英

How to add a primary key to a View - Oracle

I have a View in an Oracle database. I want to use this view in my ASP.NET MVC project. I know that in order to add that view to EF, that view needs to have a primary key. I don't know how to add a primary key as a new column to that view. None of the columns in the view is unique. How can I add that? Thanks.

Building on Ivan's comment, you could build your view like this:

SELECT rownum, *
  FROM (your_current_view_query)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM