Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Counting Names
Message
From
28/12/1999 17:17:50
 
 
To
28/12/1999 16:01:04
Rebecca Burlingame
Pima County Superior Court
Tucson, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00309467
Message ID:
00309553
Views:
25
>Is anyone out there a SQL expert? I'm trying to count all the people in my personnel table and group them by first letter of last name. I want my result set to look like this:
> A 203
> B 309
> C 594
>
> etc.
>
>I can do this with multiple count statements, but am wondering if it is possible with a single SQL select statement.
>

Try:

SELECT UPPER(LEFT(LastName,1)) AS LstInit, COUNT(*) As NumLstInit;
INTO CURSOR CountInitials ;
GROUP BY LstInit
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform