compudude86
IS-IT--Management
- Jun 1, 2006
- 46
ok, so i have a view, how would i put a primary key into it? i have this code:
DROP VIEW IF EXISTS `Book`.`view`;
CREATE ALGORITHM=UNDEFINED DEFINER=`server`@`` SQL SECURITY DEFINER VIEW `view` AS select `Products`.`ID` AS `ID`,`Products`.`Description` AS `Description`,`Products`.`Size` AS `Size`,`Products`.`Pack` AS `Pack`,`Products`.`List` AS `List`,`Products`.`Net` AS `Net`,`Products`.`Discount` AS `Discount`,`Products`.`NetBtl` AS `NetBtl`,`Products`.`SRP` AS `SRP`,`Products`.`Vendor` AS `Vendor`,`Products`.`Date` AS `Date`,concat(round((((`Products`.`SRP` - `Products`.`NetBtl`) * 100) / `Products`.`SRP`),0),_utf8'%') AS `GPM` from `Products`;
how do i make `ID` show as a primary key?
DROP VIEW IF EXISTS `Book`.`view`;
CREATE ALGORITHM=UNDEFINED DEFINER=`server`@`` SQL SECURITY DEFINER VIEW `view` AS select `Products`.`ID` AS `ID`,`Products`.`Description` AS `Description`,`Products`.`Size` AS `Size`,`Products`.`Pack` AS `Pack`,`Products`.`List` AS `List`,`Products`.`Net` AS `Net`,`Products`.`Discount` AS `Discount`,`Products`.`NetBtl` AS `NetBtl`,`Products`.`SRP` AS `SRP`,`Products`.`Vendor` AS `Vendor`,`Products`.`Date` AS `Date`,concat(round((((`Products`.`SRP` - `Products`.`NetBtl`) * 100) / `Products`.`SRP`),0),_utf8'%') AS `GPM` from `Products`;
how do i make `ID` show as a primary key?