且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何映射两个数据表

更新时间:2023-01-31 12:49:31

这很简单!



1-在NewMenu表中创建MenuId列主键

2- UserRightsId列应该是MenuId列的外键,也就是说,此列应该包含现有的MenuID。

3-编写SQL查询以选择NewMenu表将其加入UserRights表UserRights.UserID =CurrentUserid



希望有帮助
That is simple!

1- Make MenuId column primary key in your NewMenu Table
2- UserRightsId column should be foreign key to MenuId column, that is, This column should contain existing MenuIDs.
3- Write SQL Query to Select NewMenu table Join it to UserRights Table where UserRights.UserID = "CurrentUserid"

Hope that helps