我有 4 张桌子:
Foreign Key----FK
Primary Key----PK
ticket(id,FK_ticketopenby,FK_closeby,FK_createby,FK_tickettype)
ticketcategoies(PK_ID,name,ticketid)
user(name,PK_id)
usertype(PK_id,designation,FK_userid)
用户 ID 是外键 (FK),如 FK_closeby,FK_createby,FK_tickettype
用户是管理员或客户工单是后续或用户
所需的 linq 查询结果
-----------------------------------------------------------------
| Usertype | TicketType | Totalopen | TotalClose | TotalCreated |
-----------------------------------------------------------------
| admin | FollowUP | 324 | 2323 | 232 |
-----------------------------------------------------------------