BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SQL & GROUP BY / Adding Record Numbers ...

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO)
View previous topic :: View next topic  
Author Message
Vladimir Stefanovic
Guest





PostPosted: Fri Jul 01, 2005 3:22 pm    Post subject: SQL & GROUP BY / Adding Record Numbers ... Reply with quote



Hi,

I need help with SQL statement. If I have a basic
grouping statement like this:

SELECT Field, COUNT(Field)
FROM SomeTbl
WHERE OtherField ='Something'
GROUP BY Field
ORDER BY Field

I'll get something like this:

AAA 5
BBB 3
CCC 1
DDD 6
EEEE 3

But How can I assing the record numbers?

1 AAA 5
2 BBB 3
3 CCC 1
4 DDD 6
5 EEEE 3




--
Best regards,
Vladimir Stefanovic


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.