Comments on many tables database design issue

后端 未结 5 903
予麋鹿
予麋鹿 2021-01-07 05:57

I have tables:

Articles{...}
Recipes{...}
Notifications{...}
Photos{...}

And I need to implement \'user comments\' feature (like facebook).

5条回答
  •  醉梦人生
    2021-01-07 06:40

    SELECT TOP 1000 [Comments_Id]
          ,[Comments_Text]
          ,[Comments_IsApproved]
          ,[Comments_IsVisible]
          ,[Comments_DateStamp]
          ,[Type_Id]
          ,[Entity_Id] -- From Entity Table, listing Articles, Recipes etc. 
          ,[EntityItem_Id] -- One of the PK from table of Articles, Recipes etc.
          ,[User_Id]
      FROM [tbl_Comments]
    

提交回复
热议问题