Hi NG,
I have the following problem that I hope you can help me with (MS-SQL server
2000)
Imagine a statement like this:
"select id, firstname, (select top 1 id from testdata) as testid, lastname
from nametable order by firstname"
I would like to have this grouped by "lastname". ..I assume that I have to
use the "Group by" clause, but it keeps complaining about id, firstname, etc
not being in the clause...if I just inserts the "Group by lastname" in the
statement above.
How do I group these data?
--
regards,
Summa
I have the following problem that I hope you can help me with (MS-SQL server
2000)
Imagine a statement like this:
"select id, firstname, (select top 1 id from testdata) as testid, lastname
from nametable order by firstname"
I would like to have this grouped by "lastname". ..I assume that I have to
use the "Group by" clause, but it keeps complaining about id, firstname, etc
not being in the clause...if I just inserts the "Group by lastname" in the
statement above.
How do I group these data?
--
regards,
Summa
Comment