|
-
Oct 8th, 2002, 06:03 AM
#1
Thread Starter
Member
A SQL Query Question!
I have this query:
SELECT LEFT(CallerTelNumber, 2) AS Series
FROM Call
ORDER BY CallerTelNumber
The result is when I run it:
78
78
78
79
79
79
79
79
91
91
...
But what I want, is to group them by that expression I used in the select statement itself 'LEFT(CallerTelNumber, 2) AS Series' to get the following:
78
79
91
...
so i tried using this query...
SELECT LEFT(CallerTelNumber, 2) AS Series
FROM Call
GROUP BY Series
ORDER BY CallerTelNumber
I thought it would work but it didn't, so can someone direct me please as to how I can group a resultset by expression, or if there is a workaround, I'd appreicate the tip...
Thx a lot
V.P.
-----------------
To steal ideas from one person is plagiarism;
to steal from many is research.
Visual Poet :^)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|