Is inner join the same as equi-join?

前端 未结 6 889
萌比男神i
萌比男神i 2020-12-05 09:33

Can you tell me if inner join and equi-join are the same or not ?

6条回答
  •  星月不相逢
    2020-12-05 09:55

    If there has to made out a difference then ,I think here it is .I tested it with DB2. In 'equi join'.you have to select the comparing column of the table being joined , in inner join it is not compulsory you do that . Example :-

    Select k.id,k.name FROM customer k
    inner join  dealer on(
    k.id =dealer.id
    )
    

    here the resulted rows are only two columns rows

    id    name
    

    But I think in equi join you have to select the columns of other table too

    Select k.id,k.name,d.id FROM customer k,dealer d
    where
    k.id =d.id
    

    and this will result in rows with three columns , there is no way you cannot have the unwanted compared column of dealer here(even if you don't want it) , the rows will look like

     id(from customer) name(from Customer) id(from dealer)
    

    May be this is not true for your question.But it might be one of the major difference.

提交回复
热议问题