Why do multiple-table joins produce duplicate rows?

前端 未结 4 1502

Let\'s say I have three tables A, B, and C. Each has two columns: a primary key and some other piece of data. They each have the same number of rows. If I JOIN

4条回答
  •  悲&欢浪女
    2020-12-24 11:57

    If one of the tables M, S, D, or H has more than one row for a given Id (if just the Id column is not the Primary Key), then the query would result in "duplicate" rows. If you have more than one row for an Id in a table, then the other columns, which would uniquely identify a row, also must be included in the JOIN condition(s).

    References:

    Related Question on MSDN Forum

提交回复
热议问题