Question : sql server

is there a way in sql server to get multiple distinct values, i just get the first col back?

Answer : sql server

H

The  Distinct cluase alwyas work on all columns in the select (and not only 1)

select distinct A,B
from X

select distinct A,B
from X
GROUP BY A,B

Will give you the same resoulds

Think about it....
If you got many values of B    for a specific A what resould  sould it choose for a specifc A value?


good luck!
Random Solutions  
 
programming4us programming4us