Hi, this may be very simple, but I don't know how to do:
suppose I have the following TableX
COD NAME
1 Tim
2 Jason
2 Paul
3 Mark
I want a distinct on COD field. If I try this
SELECT DISTINCT(COD), NAME FROM TableX
then I will receive the whole table.
How can I receive something like this:
COD NAME
1 Tim
2 Paul or Jason, is not impourtant form me
3 Mark
Are there in T-SQL aggregate function for text? I.e. the first value found (this case Jason).
Thanks in advance
suppose I have the following TableX
COD NAME
1 Tim
2 Jason
2 Paul
3 Mark
I want a distinct on COD field. If I try this
SELECT DISTINCT(COD), NAME FROM TableX
then I will receive the whole table.
How can I receive something like this:
COD NAME
1 Tim
2 Paul or Jason, is not impourtant form me
3 Mark
Are there in T-SQL aggregate function for text? I.e. the first value found (this case Jason).
Thanks in advance