DISTINCT instruct SQL server to eliminate the duplicate
rows from the resultset and to include only one copy of
such rows. Since you select all the columns from 3 tables
it's very likely that there are columns with different
values in the resultset even though the employee_number
for example is the same. If even only one column has
different value the rows will be considered different.
Vladimir
Quote:
>-----Original Message-----
>can anyone tel me why i get results of the same employee
even when i
>write "distinct":
>SELECT DISTINCT *
>FROM Employees, employee_fields, fields
>WHERE fields.field_id= employee_fields.field_id and
>employees.employee_number=employee_fields.employee_number
>and (Employee_fields.Field_id = 51 or Head_Field_id=51 or
>Senior_Field_id=51);
>(the first rows are the join. the last 2 are the
condition)
>*** Sent via Developersdex http://www.developersdex.com
***
>Don't just participate in USENET...get rewarded for it!
>.