Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How does the following compare to a join statement?

 SELECT t1.name, t2.salary 
   FROM employee t1, info t2
  WHERE t1.name = t2.name;

would it be the equivalent to this?

   SELECT t1.name, t2.salary 
   FROM employee t1, 
   INNER JOIN info t2
   ON t1.name = t2.name;

or is it more like an outer join?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
214 views
Welcome To Ask or Share your Answers For Others

1 Answer

it will be like this without comma.

   SELECT t1.name, t2.salary 
   FROM employee t1 
   INNER JOIN info t2
   ON t1.name = t2.name;

To use INNER JOIN or LEFT or RIGHT or ... its up to you what results you want get.

related values or values which exist in other table and so on , here you can learn about the joins.

enter image description here

SOURCE


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...