Is inner join the same as equi-join?

前端 未结 6 842
萌比男神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:59

    The answer is YES, But as a resultset. So here is an example.

    Consider three tables:

    orders(ord_no, purch_amt, ord_date, customer_id, salesman_id)

    customer(customer_id,cust_name, city, grade, salesman_id)

    salesman(salesman_id, name, city, commission)

    Now if I have a query like this:

    Find the details of an order.

    Using INNER JOIN:

    SELECT * FROM orders a INNER JOIN customer b ON a.customer_id=b.customer_id 
    INNER JOIN salesman c ON a.salesman_id=c.salesman_id;
    

    Using EQUI JOIN:

    SELECT * FROM orders a, customer b,salesman c where 
    a.customer_id=b.customer_id and a.salesman_id=c.salesman_id;
    

    Execute both queries. You will get the same output.

    Coming to your question There is no difference in output of equijoin and inner join. But there might be a difference in inner executions of both the types.

提交回复
热议问题