Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Sorting

Author  Topic 

vbjohn
Starting Member

32 Posts

Posted - 2005-02-04 : 15:37:29
I have this query and I need to be sort by the Word Name and grouped by the WordID.

Before this is what they had and it never did that.

WordID WordName
-------- ----------
2 2
2 Two
3 3
3 Three
190 THEATER
190 THEATRE
192 SPC
192 SPCL
192 SPEC
192 SPECIAL

So when I go into the query and Sort by WordName I get:

WordID WordName
-------- ----------
2 2
3 3
190 THEATER
190 THEATRE
3 Three
2 Two
192 SPC
192 SPCL
192 SPEC
192 SPECIAL


This is my query:

SELECT
WordEquivId,
WordEquivalent
FROM ListWordEquivalents
WHERE EXISTS (
SELECT Null FROM ListWordEquivalents B
WHERE B.WordEquivId=ListWordEquivalents.WordEquivId
GROUP BY B.WordEquivId, B.WordEquivalent) ORDER BY WordEquivId

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2005-02-04 : 16:06:56
quote:
So when I go into the query and Sort by WordName I get:

quote:
ORDER BY WordEquivId


you're sorting by WorkEquivID

Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -