![]() However this is not possible in the DISTINCT query. This will open a window like this containing a single ER Diagram for the table - In this diagram, the primary keys can be seen marked as bold under the table name, in the second partition. ![]() Most entities in EF have a single key, which maps to the concept of a primary key in relational databases (for entities without keys, see Keyless entities ). For a given table, right click on the table name (in Database Navigator) -> select View Diagram. In effect I want to add id as an ancillary column to (distinct) sBrand and idPartner. Configuring a primary key Value generation Primary key name Key types and values Alternate Keys A key serves as a unique identifier for each entity instance. All other solutions I have seen online (ie PARTITION, ORDER_BY) are for other versions of SQL.Įdit: I want to output unique values for partner and brand, ie: +-+-+īut due to controller design, an id is expected. Make dummy table that has same structure with your Create View. My first thought is to query DISTINCT, then ALTER VIEW to tack on an id column, but apparently in order to edit a view you need to re-instantiate the original CREATE commands, thus rendering the whole effort pointless. Including 'id' w/ DISTINCT will not work. How to Implement Materialized Views in MySQL / MS-SQL Generalization (must hand-code and test MV-create and triggers) View index (MV primary key) must be. However, I need to also include a primary key to satisfy the retrieving API resource. I would like distinct id sBrand and idPartner values, calling something like this: CREATE VIEW VBrand As select distinct sBrand, id, idPartner from tblProduct | idPartner | int(10) unsigned | NO | MUL | NULL | | | id | bigint(20) unsigned | NO | PRI | NULL | auto_increment | ![]() ![]() | Field | Type | Null | Key | Default | Extra | I am trying to create a view based on the following mySQL table: +-+-+-+-+-+-+ ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |