[Solved] SQL Server inner join returns the same row repeatedly in all the column

[ad_1]

Presumably, you have more orders than you have employees. Hence, one employee is on many orders.

When you run:

select e.firstname 
from employees e inner join
     orders o
     on e.employeeid = o.employeeid;

Then you are getting a list of all first names — so one employee name is going to be repeated, once per each order. If you want just a list of the distinct values, then you can use select distinct instead.

[ad_2]

solved SQL Server inner join returns the same row repeatedly in all the column