0
我有兩組sql查詢。兩者都爲我產生了期望的結果,但我不確定哪一個是有效的以及如何。有人可以向我解釋嗎?兩個sql查詢之間的區別(使用連接和不連接)
查詢1:
SELECT
od.id, od.order_id, c.firstname, od.category, od.quantity,
od.price, o.order_date, u.username
FROM
orders o inner join order_detail od on o.id=od.order_id
join customer c on c.customerid = o.customer_id
join users u on u.userid = o.issued_by;
問題2:
SELECT
od.id, od.order_id, c.firstname, od.category, od.quantity,
od.price, o.order_date, u.username
FROM
order_detail od, customer c, orders o,
users u WHERE o.id = od.order_id
AND o.customer_id = c.customerid
AND u.userid = o.issued_by;