How can I have individual count of each branch?

Hi,
I need to write a query for the following scenario.
For ex: Reliance is a company which is has diffenect branches under city1, city2, city3.
under city1 we have different regions like reg1, reg2, reg3. Under city2 we have reg4, reg5. Similarly under city3 we have reg7, reg8, reg9. Under each region we have got 2 participants like reg1 - p1, p2 reg2- p3, p3 and so on under each region.
I need to write a query such that i can have a count of number of participants under each city. My output should be like city1 - 6 city2 4 and so on.
Can any one help me out in this???
Thanks in advance

For eg
CITY     REGION     PARTICIPANT
C1     R1     P1
C1     R1     P2
C1     R2     P3
C1     R2     P4
C2     R3     P5
C2     R3     P6
Output is as follows
CITY     COUNT(3)
C1     4
C2     2
SQL Query
with reg_data as
((select 'C1' City,'R1' Region,'P1' Participant from dual) union all
(select 'C1' City,'R1' Region,'P2' Participant from dual) union all
(select 'C1' City,'R2' Region,'P3' Participant from dual) union all
(select 'C1' City,'R2' Region,'P4' Participant from dual) union all
(select 'C2' City,'R3' Region,'P5' Participant from dual) union all
(select 'C2' City,'R3' Region,'P6' Participant from dual))
select City,count(3) from reg_data
group by City

Similar Messages

  • If I have two email accounts, one personal hotmail account and one MS Exchange work account, how can I setup individual notifications for each account. Right now, any email from any account has the same notification. I want work to be different than perso

    If I have two email accounts, one personal hotmail account and one MS Exchange work account on my iPhone 4s, How can I setup individual notifications for each account? Fore example, if I get a work email, I want to hear a DING, DING....If I get a personal email, I want to hear a BEEP, BEEP. Right now, any email from any account has the same notification. I want work incoming email notification to be different than personal incoming notification. The only semi-workaround I've seen is just disable any notification for the Hotmail account, so only work emails would notify. But then I don't know when I get a personal email. Even the lowely Blackberry Torch 9800 has this feature..not iPhone 4s??
    Thanks

    Sorry you get only one notification sound for all email accounts.  you can send a suggestion to apple here http://www.apple.com/feedback/

  • How can I have one row for each object?

    Post Author: farnaz
    CA Forum: WebIntelligence Reporting
    I have 3 objcts that one of them is ID and second one is internal code and the third one is quantity.There is more than one value for each ID (becouse of internal code).I want to create a report based on ID and quantity (not based on internal code).I make a break on ID but the result shows me more than one row for each ID.so how can i have just one row for each ID?
    another question:
    how can I post screen shot of the results to my messag in forum?

    Post Author: jsanzone
    CA Forum: WebIntelligence Reporting
    farnaz:
    Have you tried to omit "internal code" from your grid?  In normal circumstances, if you have "ID" and "Quantity" on the grid, then WebI will on its own summarize Quantity based on ID, however, this is provided that Quantity has been set up as a measure (or metric).  The quickest way to tell if Quantity is a metric or not is to observe the color of its icon when you look at it in the data panel.  If it is a purple (or sometimes appears as pink or fuscia) dot, then it's a measure, but if it is a blue box then it is a dimension.  If you need Quantity as a measure then this will have to be modified at the universe (make it look like "sum(Quantity)" in the select phase of the object, and insure the object is defined as a number....

  • TabbedPanels Tab - How can we put individual images on each tab button?

    Hi,
    How can we put individual propeties (like size, background images etc) in each tab button of TabbedPanels Tab?
    Thanks

    Wow ! Itz amazing !! .... This is what 'm exactly looking for
    Thanks a lot Gramps
    Alin

  • How can I calculate the count of each row and they are grouped in each mth?

    hi, I need help on a database question. How can I count the number of record grouped by the last 12 months? I don't know any way to iterate the month one by one so that it return a table like this:
    table_item
    id item
    1 A
    2 B
    3 C
    4 D
    table_record
    item date
    A 2006-01-01
    A 2006-01-01
    A 2006-01-01
    B 2006-02-01
    A 2006-03-01
    C 2006-04-01
    A 2006-04-01
    D 2006-05-01
    A 2006-05-01
    A 2006-12-01
    and I need a query to output following table:
    item_count_in_2006
    item 06-01 06-02 06-03 06-04 06-05 06-06 06-07 06-08 06-09 06-10 06-11 06-12
    A 3 1 1
    B 1
    C 1
    D 1
    I tried so many way to do it.. I think SQL can't even product a table like that. Please give me some comments.
    Thanks!

    select c1,
           count(decode(to_char(c2,'YYYYMM'),'200601',1)) "200601",
           count(decode(to_char(c2,'YYYYMM'),'200602',1)) "200602",
           count(decode(to_char(c2,'YYYYMM'),'200603',1)) "200603",
           count(decode(to_char(c2,'YYYYMM'),'200604',1)) "200604",
           count(decode(to_char(c2,'YYYYMM'),'200605',1)) "200605",
           count(decode(to_char(c2,'YYYYMM'),'200606',1)) "200606",
           count(decode(to_char(c2,'YYYYMM'),'200607',1)) "200607",
           count(decode(to_char(c2,'YYYYMM'),'200608',1)) "200608",
           count(decode(to_char(c2,'YYYYMM'),'200608',1)) "200609",
           count(decode(to_char(c2,'YYYYMM'),'200610',1)) "200610",
           count(decode(to_char(c2,'YYYYMM'),'200611',1)) "200611",
           count(decode(to_char(c2,'YYYYMM'),'200612',1)) "200612"
    from   tbl
    group by c1
    C     200601     200602     200603     200604     200605     200606     200607     200608     200609     200610 
    D          0          0          0          0          1          0          0          0          0          0          0          0
    A          3          0          1          1          1          0          0          0          0          0          0          1
    B          0          1          0          0          0          0          0          0          0          0          0          0
    C          0          0          0          1          0          0          0          0          0          0          0          0Nicolas.

  • How can I have threads communicate with each other?

    I'm working on a project that requires a group of classes communicating with each other. I decided on using a server and carrying out communication that way. However, my app only has communication between the client and server. I need the clients to be able to communicate with each other. Does anyone know how I can do this or point me to a good tutorial?

    Sorry, here's a bone stock example of my server and client:
    <SERVER>
    package testserver;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    public class TestServer
    static int portOpen;
    public static void main(String[] args)
    portOpen=4000;
    try
    ServerSocket portListener = new ServerSocket(portOpen);
    TestServer userThreads = new TestServer();
    while (1==1)
    Socket userConnection=portListener.accept();
    userThreads.new PortConnection(userConnection);
    catch (Exception e)
    System.out.println("The server encountered a serious error. Server shut down.");
    e.printStackTrace();
    System.exit(0);
    class PortConnection extends Thread
    //Declare variables to handle connections.
    Socket ourConnection;
    BufferedReader serverInput;
    PrintWriter serverOutput;
    PortConnection(Socket userConnection)
    try
    ourConnection=userConnection;
    serverInput=new BufferedReader(new InputStreamReader(userConnection.getInputStream()));
    serverOutput=new PrintWriter(userConnection.getOutputStream(),true);
    start();
    catch (Exception e)
    System.out.println("An error occurred when a user attempted a connection.");
    public void run()
    serverOutput.println("Welcome to the Server.");
    try
    serverOutput.close();
    serverInput.close();
    ourConnection.close();
    catch (Exception e)
    </SERVER>
    <CLIENT>
    package testclient;
    import java.io.*;
    import java.util.*;
    import java.net.*;
    public class TestClient {
    static BufferedReader userInput;
    static Socket quizServer;
    static BufferedReader serverInput;
    static PrintWriter serverOutput;
    static String serverData;
    public static void main(String[] args) {
    userInput = new BufferedReader(new InputStreamReader(System.in));
    try {
    quizServer=new Socket("localhost",4000);
    catch (Exception e) {}
    try
    serverInput=new BufferedReader(new InputStreamReader(quizServer.getInputStream()));
    serverOutput=new PrintWriter(quizServer.getOutputStream(),true);
    catch (Exception e) {}
    try {
    serverData=serverInput.readLine();
    catch (Exception e) {}
    System.out.println(serverData);
    </CLIENT>

  • How can I have a notification for each PO Receipt entered?

    Hi Friends,
    I have a requirement to send notifications to the Finance users, of the fact that a PO receipt occurred.. Do we have any standard feature for this? I read through the documentations but every notification looks to be for approvals..
    Regards,

    You can develop an Oracle alert to send notification upon creating receipts.

  • How can i have 2 tabs open,each tab signed into different email accounts

    new user to firefox. i wish to share firefox with my partner but want to be able to automatically open both mine and hes email account on different tabs without setting up anther user account

    You can do this by using an add-on. There are several add-ons that offer this functionality, such as:
    * [https://addons.mozilla.org/en-US/firefox/addon/200283/ Multifox] (more info on the home page [http://br.mozdev.org/multifox/])
    * [https://addons.mozilla.org/en-US/firefox/addon/3255/ CookieSwap]
    * [http://www.nektra.com/products/cookiepie-tab-firefox-extension CookiePie]

  • If you have two iphone 4s on the same Itunes account how can you keep seperate info on each phone i.e contacts and apps etx

    My wife and I have Iphone 4s phones, and the same itunes account on two laptops, when she started her phone for the first time all my contacts were deleted how can we have seperate details on each phone, or do we need seperate accounts

    Thanks for the help. Took a bit of time and I'll need her phone (when she's back) to get it all straight...I think! :-)

  • When I have a pdf file open, I used to be able to click on "Bookmarks" tab on left side and allow me to click on each individual page and delete if I needed to.  Now when I click on the Bookmarks tab, that section is empty.  How can I get it to show each

    when I have a pdf file open, I used to be able to click on "Bookmarks" tab on left side and allow me to click on each individual page and delete if I needed to.  Now when I click on the Bookmarks tab, that section is empty.  How can I get it to show each page again?

    Hi chrismarks1,
    I think you may be confusing bookmarks with thumbnails. If you click the Page Thumbnails icon (the one above the Bookmarks icon), then you can delete a page by clicking its thumbnail, and clicking the Delete Pages icon (the trashcan icon). Just make sure that you're viewing the PDF file in Acrobat (rather than Acrobat Reader), as you can't delete pages from Reader.
    Best,
    Sara

  • In Contacts version 8, how can I print ALL information in each individual card? When I select the print command the only thing printed is the name and address. I need phone number(s) and all other information in the cards.

    In Contacts version 8, how can I print ALL information in each individual card? When I select the print command the only thing printed is the name and address. I need phone number(s) and all other information in the cards. We enter various pieces of data, other than the standard name address & phone numbers and we print all information on each card so it fits in a 5x7 inch loose binder. We have used InTouch software for many years and it has served us extremely welll, however, the publisher (The Prairie Group) has not, and apparently has no plans to update their software to be compatible with any Mac OSX OS beyond 10.6. Any help will be appreciated!

    You can select what you want included in a list format. In the Print command from Contacts, click the Show Details button. Then in the Style pulldown menu select "Lists" and there you'll be able to select what you want included. You can also select what you wish included if you select the Pocket Address Book style.
    If neither of those options will work for you, then you will need to look to third-party software. Here's one possibility that seems to get good reviews:
    https://www.macupdate.com/app/mac/15485/labels-&-addresses
    I haven't done more than try it to make sure that it works with OS X 10.9's Contacts, which it does, but you can download their demo and try it yourself.
    Regards.

  • Can 2 different users with 2 different Iphones use the same itunes to backup each phone separately? if not how can I have a backup for 2 different iphones on the same laptop?

    can 2 different users with 2 different Iphones use the same itune program to backup each phone separately? if not how can I have a backup for 2 different iphones on the same laptop?

    Here is your answer:
    http://support.apple.com/kb/HT1495

  • I am uploading receipts using the PURCHASE_ORDER_RECEIPT EIP.  When I upload serialized assets each one is processed as a separate receipt (receiver_id). How can I have these all aggregated on the same receipt?

    I am uploading receipts using the PURCHASE_ORDER_RECEIPT EIP.  When I upload serialized assets each one is processed as a separate receipt (receiver_id). How can I have these all aggregated on the same receipt?
    Is there a parameter I should be using in the XML or is there a setting in Peoplesoft that will accomplish this?
    Jim

    sundy.liu wrote:
    Unfortunately however, even with the TCP tweaks enabled, I still only get a little over 1 Gb/s through the two aggregated Gig ports. It seems as though the aggregation is only using one port, though MRTG graphs of the two switch ports do in fact show that they are both being utilized equally, essentially splitting the 1 Gb/s speed between
    the two ports.
    Problem with the server? switch? Aggregation software? All the above? At any rate, I seem to be missing something.. Any help regarding this issue would be greatly appreciated!If you're only running a single stream, that's all you'll see. Teaming/aggregating doesn't make one stream go faster.
    If you ran two streams simultaneously, then you should see a difference between a single 1G interface and an aggregate of two 1G interfaces.
    Darren

  • TS1424 I have 2 iPads and one Id how can I create one id for each iPad?

    I have two iPads and when I download an app it appears on both iPad , how can I have two ids, one for each iPad ?

    Why would you want two IDs? This will cause some problems.

  • How can we get help/advice amoungst each other? I have questions

    How can we get help/advice amoungst each other? I have questions which might not be bug related and thought it would be nice if we could bounce questions off each other.
    Example:
    Why is my Reflow sample behaving like this?
    Should I have some kind of settings set so things don't get all weird?
    I didn't set any breakpoints yet, but things are going weird.
    Image attached! Any insights?
    Thanks.

    You can post questions here too. If they are design questions if people know the answer they can respond too.
    For this particular issue, it does look like a design problem. From the screen shots, I'm guessing that the light gray box is using negative top margin to overlap the darker dray box. I think for this change the dark gray box to use height:auto and add a padding-bottom to it for the current space below the text. That way when the text starts to push down there will be a constant amout of space from the bottom of the text to the bottom of the dark gray box and that will push the light gray box down as well.

Maybe you are looking for

  • What is the use of Webcat,What is its role in obiee 10.1.3.3.4

    Hi , I m new to OBIEE and I want to know more about Webcat.Could somebody explain in detail about webcat and its role in obiee.Thanks in advance.

  • How to sync bookmarks with those on my iMac?

    IT would really be helpful to have the bookmarks on my iMac on my iPad Air as well, but i cannot figure out how to do it. I usually use Chrome on my macs, but i've also exported those bookmarks to Safari on the Mac. Can anyone please tell me how to s

  • Cannot open GP process task in universal worklist.

    Hi all,     I cannot open GP process task in universal worklist.It says:"Could not retrieve process instance: contact your system administrator".But i can open the task in Runtime task. i configure the universal worklist by following this link: http:

  • Annoyed with JVC/Final Cut Pro import problem; will they ever fix this?

    Annoyed with Final Cut Pro JVC import problem; will they ever fix this? I've shot footage on JVC GY-HD111E in the UK in 720p/25p PAL mode. I'm trying to import lots of short clips (average 10 seconds) into Final Cut Pro (latest version with 720p/25p

  • Unwanted contact

    i keep getting text from [email protected] saying hello. i have responded once by asking who it was and they tried to initiate video which i declined. then they went offline. how can i prevent this? has anyone else had contact like this? is it a risk