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 > MySQL > Get counts and list them

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: Nov 2012
Posts: 1
Get counts and list them

I have tables symbols and rpm.
rpm exports symbols and consumes as well.
symbol table is a collection of all symbols(exported and imported).
symbols table have id, name, rpm_id (maps to id of rpm table) , flag to show whether it is exported or imported.
rpm table is having id, name.
I want to list exported symbols by a rpm(given its id; say 35) and for each symbol I want to get the count specifying number of times it is consumed.

flag = 1; consumed
flag = 0;exported

output layout:
rpm_name | symbol_name | count(number of time this symbol is consumed overall)

please suggest some way to get the result:

Note: a symbol, which is exported by a rpm, can be used by multiple times by other rpms.

Last edited by shaikhnavid14; 11-06-12 at 03:42. Reason: added note.
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Oct 2009
Location: 221B Baker St.
Posts: 487
Suggest you show some "inpput" and the output you want when this code is run.

Your sample data needs to include data the meets all of your various criteria.
Reply With Quote
Reply

Tags
count, mysql

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