If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > SQL query request

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-02-10, 06:13
Ciro72 Ciro72 is offline
Registered User
 
Join Date: Dec 2010
Posts: 2
SQL query request

Hi all,

First post here, I have the following query:

1> select ExtractorId from dmLC_FAILQUEUE
2> go
ExtractorId
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXTR_GCD_PROD
EXTR_GCD_PROD
EXTR_GCD_PROD
EXTR_GCD_PROD
EXTR_LDN_PROD
EXTR_LDN_PROD
EXTR_LDN_PROD
EXTR_LDN_PROD
EXTR_NY_PROD
EXTR_NY_PROD
EXTR_NY_PROD
EXTR_SNG_PROD


I've been trying to develop a subquery that allows me to count the number of times every different ExtractorId appears in the query (for example EXTR_GCD_PROD 4, EXTR_LDN_PROD 4, EXTR_NY_PROD 3, etc) but no luck so far. Any ideas how this could be done?
Reply With Quote
  #2 (permalink)  
Old 12-02-10, 08:33
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,538
use COUNT(*) with GROUP BY
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 12-02-10, 09:18
Ciro72 Ciro72 is offline
Registered User
 
Join Date: Dec 2010
Posts: 2
Thanks very much!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On