Query regarding groups

Hi All
I have a query
Name TC defects
A UT 1
A VT 2
B UT 3
A UT 4
B VT 5
A PT 6
I want the sum of all the defects in different columns
NAME UT VT PT
A 2 1 1
B 1 1 0
Thanks for your help
Edited by: user_7000013 on Oct 20, 2010 11:57 AM

this should helpful to you
SQL> edit
Wrote file afiedt.buf
  1  select case when a = 'A' then a else a end "a",
  2         count(case when b = 'UT' then b end) "UT",
  3         count(case when b = 'VT' then b end) "VT",
  4         count(case when b = 'PT' then b end) "PT"
  5  from(
  6  select 'A' a,'UT' b,1 c from dual union all
  7  select 'A','VT', 2 from dual union all
  8  select 'B','UT', 3 from dual union all
  9  select 'A','UT', 4 from dual union all
10  select 'B','VT', 5 from dual union all
11  select 'A','PT', 6 from dual)
12* group by  case when a = 'A' then a else a end
SQL> /
a        UT        VT        PT
A         2         1         1
B         1         1         0
SQL> kanish

Similar Messages

  • Query regarding grouping of 11i baseline patches

    Hello,
    Application : 11.5.10.2
    DB : 10.2.0.4
    OS : AIX 6.1
    We are thinking of applying the 11i baseline patches in two groups/phases as mentioned below. We have in total 33 baseline patches (plus pre and post reqs too) to apply.
    Keeping in mind the functional testing that will be required all the bug fixes brought over by the new baseline patches, we believe that by applying the patches in two phases will be easy for us .
    Group 1
    · Logistics
    · Manufacturing
    · Order Management
    · Supply Chain Planning
    Group 2
    · Finance
    · Projects
    · Procurement
    · Human Resources
    Do you see any issue with applying the 11i baseline patches in two phases?
    Thanks,
    Brij

    I will be doing the dependency check among the modules. Anyhow If pre-req patch of one module (say M1) is actually a main Bpatch for other module (say M2), we have to apply the M2 module first.Correct.
    True, that doing such patching in one phase is good to reduce number of outage to single.
    But as per our last estimation while applying baseline patching on test instance, it took approx 40-45 Hrs to apply all patches (150 patches approx base+pre-req combined ). So asking for such big outage time on Prod instance will also not be possible.I understand as this depends on the number of patches/modules/languages and the hardware resources.
    Good Luck!
    Hussein

  • Query regarding DB_16k_CACHE_SIZE

    Hi Friends,
    I have got a urgent query regarding db_16k_cache_size parameter.I have created a tablespace with 16k block size,and i have configured the db_16k_cache_sieze to 208M accordingly.I have kept a table in this tablesspace whose presenet size is 323 GB.Some complex queries will be running on this table comprising groups,some complex joins,ordes,analytical functions etc.
    I am having 8 GB of SGA.Now my query is whether i have to increase the db_16k_cache_szie parameter from its present size to get better performance and if it is then how to detemine what will be the optimal size of db_16k_cache_size.
    Please help...
    Thanks
    somy

    Post your query what u have tried. Then only we might be help with you

  • Query regarding database access segregation using os authentication in windows environment

    Hi ,
    I have a query regarding database access segragation using os authentication (like sqlplus "/ as sysdba") in windows environment.Let me briefly explain my requirement:-
    Suppose you have two DBA`s viz DBA1 and DBA2 and 4 databases resideds in a windows server say A,B,C & D.Now I want to set up such a way if DBA1 logs into the server then he can login to database A and B only using OS authentication and DBA2 can login to database C and D only using OS authentication.
    Please let me know how to do setup for this requirement.
    Database version is 11.2.0.3

    1494629, I am not a Windows person but if there is any way to do this I suspect some additional information is necessary:
    Are the DBA users members of the Administrators Group ?
    Do all 4 database share the same $ORACLE_HOME ?
    I suspect if either answer above is yes then this is not possible, but like I said I am not a Windows person.  I would just ask for two servers and the associated licensing to be acquired.  The requirement to spend money to do something management wants usually elimanates the request in my world.
    HTH -- Mark D Powell --

  • Query regarding Transfer order creation

    Hi Experts,
    I have query regarding on creation of transferorder in WM.
    1) Once the delivery order received from SD ,  How  WM people  will proceed with that delivery order?
    2) Is it possible  to create transfer order for each item avaliable in delivery order?
    3)  Is there any chance to partial delivery/ partial picking against that delivery order?
    Please guide..
    Points willl be rewarded ..
    Thanks in advance..

    1.once the delivery order received from SD, WM will start up with creating a wave pick thru outbound delivery monitor(VL06P), then trasnfer order (TO)is created , then TO is confirmed and goods issue is posted.
    2.yes it is possible to create transfer order for each item avaliable in delivery order, if the delivery items are not grouped under a wave pick.
    3.partial delivery can be made

  • Query Designer - Query:Specialist Group Status

    Hi Gurus,
    One of my BI user is getting error in this:
    In Query Designer - Query:Specialist Group Status
    "Registered JIT debugger is not avialable. An attempt to launch a JIT debugger with the following
    command resulted in an error code of 0x2(2). please check computer settings.
    cordbg.exe !a 0x289c"
    but when I tried with SUPER USER access i am not getting above error.
    Guys please suggest me asap
    Thanks
    sahad

    hello,
    Check the variabledefinitions of the query.
    Try RSRT and 'execute and debug'.
    It might be you get a lot more detailed information about the problem.
    see OSS note 961995.
    Regards,
    Dhanya

  • OIM - query regarding child tables

    Hi All
    I have a query regarding child tables. For example, when a user is removed from an AD group, his corresponding entry from the AD groups child table will be deleted. I want to know whether it is deleted of marked as deleted. Can I get the information later on that the user was removed from which AD group?
    Please help.
    Thanks

    You will have to enable the audit level = Resource Form and perform the additional tasks to track the process form data changes. This will track all modifications to the forms.
    -Kevin

  • Query regarding Pagination

    Hi all,
    I have a query regarding the Pagination in the table component.I have a table and this table has been paginated with size 5. I am using an ObjectListdataprovider for populating data in table.Here i populate the ObjectList from another page and show it here in another page.Here we can chane the data.when i am clicking on the save it only considering the first 5 values dat is currently showing.This thing happens only when i didn't go the the second page using page navigation buttons.That is it ony saves the data that got focus.Can anyone have any solution?Please help me..
    Thanks and Regards
    Sree

    Do you have a message group component on the page to display runtime errors?
    Did you check the server log (right-click Deployment Server and choose View Server Log) to see if any errors show up there?
    Do you have any table colomn components bound to non-string fields? If so, did you drop the right type of converters on those components?

  • Query regarding updation thru a Procedure

    Hi,I have a query regarding updation.
    1.I invoke a procedure in Oracle called submit thru my Java application.
    The submit procedure saves the XML data in the database
    and displays this data in a Front End GUI.
    2. Now,I make a change in my Java application by adding new elements to the same row.This row now contains additional XML elements.
    I would like to display the new row with the new elements in the GUI.
    What is a better option for doing the above?
    1.Delete the row being shown,save the new row with the changes in the database,and re display it?
    2.Or,Update the row dynamically and refresh?
    Any suggestions
    Thanks,

    Hi,I have a query regarding updation.
    1.I invoke a procedure in Oracle called submit thru
    my Java application.
    The submit procedure saves the XML data in the
    database
    and displays this data in a Front End GUI.
    2. Now,I make a change in my Java application by
    adding new elements to the same row.This row now
    contains additional XML elements.
    I would like to display the new row with the new
    elements in the GUI.
    What is a better option for doing the above?
    1.Delete the row being shown,save the new row with
    the changes in the database,and re display it?
    2.Or,Update the row dynamically and refresh?
    Any suggestions
    Thanks,If you delete (it seems to me yours this process is regular and frequent) and re insert the new updated one record then High water mark will cause to scan yours table which may cause to degrade the performance.AFAIK you should go with update.But hold down dont implement it as i suggested lets see what are others solution here which may be more precious then mine.
    Khurram

  • A query regarding synchronised functions, using shared object

    Hi all.
    I have this little query, regarding the functions that are synchronised, based on accessing the lock to the object, which is being used for synchronizing.
    Ok, I will clear myself with the following example :
    class First
    int a;
    static int b;
    public void func_one()
    synchronized((Integer) a)
    { // function logic
    } // End of func_one
    public void func_two()
    synchronized((Integer) b)
    { / function logic
    } // End of func_two
    public static void func_three()
    synchronized((Integer) a)
    { // function logic
    } // End of func_three, WHICH IS ACTUALLY NOT ALLOWED,
    // just written here for completeness.
    public static void func_four()
    synchronized((Integer) b)
    { / function logic
    } // End of func_four
    First obj1 = new First();
    First obj2 = new First();
    Note that the four functions are different on the following criteria :
    a) Whether the function is static or non-static.
    b) Whether the object on which synchronization is based is a static, or a non-static member of the class.
    Now, first my-thoughts; kindly correct me if I am wrong :
    a) In case 1, we have a non-static function, synchronized on a non-static object. Thus, effectively, there is no-synchronisation, since in case obj1 and obj2 happen to call the func_one at the same time, obj1 will obtain lock for obj1.a; and obj2 will obtain lock to obj2.a; and both can go inside the supposed-to-be-synchronized-function-but-actually-is-not merrily.
    Kindly correct me I am wrong anywhere in the above.
    b) In case 2, we have a non-static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a. However, since obj1.a and obj2.a are the same, thus we will indeed obtain sychronisation.
    Kindly correct me I am wrong anywhere in the above.
    c) In case 3, we have a static function , synchronized on a non-static object. However, Java does not allow functions of this type, so we may safely move forward.
    d) In case 4, we have a static function, synchronized on a static object.
    Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a. However, since obj1.a and obj2.a are the same, thus we will indeed obtain sychronisation. But we are only partly done for this case.
    First, Kindly correct me I am wrong anywhere in the above.
    Now, I have a query : what happens if the call is made in a classically static manner, i.e. using the statement "First.func_four;".
    Another query : so far we have been assuming that the only objects contending for the synchronized function are obj1, and obj2, in a single thread. Now, consider this, suppose we have the same reference obj1, in two threads, and the call "obj1.func_four;" happens to occur at the same time from each of these threads. Thus, we have obj1 rying to obtain lock for obj1.a; and again obj1 trying to obtain lock for obj1.a, which are the same locks. So, if obj1.a of the first thread obtains the lock, then it will enter the function no-doubt, but the call from the second thread will also succeed. Thus, effectively, our synchronisation is broken.
    Or am I being dumb ?
    Looking forward to replies..
    Ashutosh

    a) In case 1, we have a non-static function, synchronized on a non-static object. Thus, effectively, there is no-synchronisationThere is no synchronization between distinct First objects, but that's what you specified. Apart from the coding bug noted below, there would be synchronization between different threads using the same instance of First.
    b) In case 2, we have a non-static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a.obj1/2 don't call methods or try to obtain locks. The two different threads do that. And you mean First.b, not obj1.b and obj2.b, but see also below.
    d) In case 4, we have a static function, synchronized on a static object. Here, again if obj1, and obj2 happen to call the function at the same time, obj1 will try to obtain lock for obj1.a; while obj2 will try to obtain lock for obj2.a.Again, obj1/2 don't call methods or try to obtain locks. The two different threads do that. And again, you mean First.b. obj1.b and obj2.b are the same as First.b. Does that make it clearer?
    Now, I have a query : what happens if the call is made in a classically static manner, i.e. using the statement "First.func_four;".That's what happens in any case whether you write obj1.func_four(), obj2.func)four(), or First.func_four(). All these are identical when func_four(0 is static.
    Now, consider this, suppose we have the same reference obj1, in two threads, and the call "obj1.func_four;" happens to occur at the same time from each of these threads. Thus, we have obj1 rying to obtain lock for obj1.aNo we don't, we have a thread trying to obtain the lock on First.b.
    and again obj1 trying to obtain lock for obj1.aYou mean obj2 and First.b, but obj2 doesn't obtain the lock, the thread does.
    which are the same locks. So, if obj1.a of the first thread obtains the lock, then it will enter the function no-doubt, but the call from the second thread will also succeed.Of course it won't. Your reasoning here makes zero sense..Once First.b is locked it is locked. End of story.
    Thus, effectively, our synchronisation is broken.No it isn't. The second thread will wait on the same First.b object that the first thread has locked.
    However in any case you have a much bigger problem here. You're autoboxing your local 'int' variable to a possibly brand-new Integer object every call, so there may be no synchronization at all.
    You need:
    Object a = new Object();
    static Object b = new Object();

  • Query regarding the conversion of DME file in MT940 format.

    Hello Experts,
    I have a query regarding the generation of MT940 file after generating the payment file from other DME tree.
    After completion of payment run, my payment file is generated in the DME format which is according to the DME tree.
    I want to convert the DME file (which is generated via F110)  from existing format to the standard MT940 format.
    Is there any standard program which converts the DME file to MT940. If so,  please inform me as early.
    I have tried to upload the DME file in FF.5 transaction, but it is not allowing me to convert the file in MT940 structure.
    Or please inform the steps how i can convert the file .
    Awaiting for your inputs.
    Thanks in advance

    Hi Zareena.
    I would like to suggest,
    SX_OBJECT_CONVERT_RAW_TXT.
    Hope that's usefull.
    Good Luck & Regards.
    Harsh Dave

  • Query regarding the data type for fetcing records from multiple ODS tables

    hey guys;
    i have a query regarding the data type for fetcing records from multiple ODS tables.
    if i have 2 table with a same column name then in the datatype under parent row node i cant add 2 nodes with the same name.
    can any one help with some suggestion.

    Hi Mudit,
    One option would be to go as mentioned by Padamja , prefxing the table name to the column name or another would be to use the AS keyoword in your SQL statement.
    AS is used to rename the column name when data is being selected from your DB.
    So, the query  Select ename as empname from emptable will return the data with column name as empname.
    Regards,
    Bhavesh

  • Query regarding Cluster nodes in CC

    Hi Experts,
    We have a query regarding the cluster nodes available in the CC monitoring.
    Can two nodes of a same channel can poll at the same time?
    Kindly suggest what should be done to make a specific cluster node of a CC polls at a particular time.
    Thanks
    Suganya.

    Hi,
    There is an answered thread on this
    Processing in  Multiple Cluster Nodes
    Regards,
    Manjusha

  • Query regarding G/LAccounts in psoting

    Hi Experts,
    I have one query regarding PCP0.
    After executing PCP0,If We double click on the posting document we can see the number of G/L accounts in that posting Document.If we double click on each G/L Account it shows all the revision information indetail for all payments cumulated into that particular G/L Account.
    Some of the G/L's are appearing as single line in the posting document and if we double click for the revision information it is showing all the Wagetypes with personnel numbers and the total of each wagetype.
    Some of the G/L's we can see Multiple times for each individual.
    Can any one please explain where does we set up the the revision information for the G/L Accounts .
    Appreciate If anyone can help to know this information.
    Thanks & Regards,
    Sandhya.

    Hi Gopal,
    Counting class are assigned to the Periodic work Schedule 1 to 9 are just arbitart sequence numbers and have no meaning in general they are used for linking Pweriodic Work schedules with differences.
    You can use the class for absence and attendance counting to specify different methods of counting according to the period work schedule.
    They have no other meaning apart from that.
    Thanks and Regards
    Swati

  • Query regarding the fields details in particular form for all the users in

    Dear All,
                  I have one query regarding the fields details in particular form for all the users in company.
    Let take an exapmle if i had created Purchase Order having fields in content tab as 1.Item No. 2.Quantity 3.Unit Proce   4.Total   5. Location.
    While Login in User manager i set these fields only for Purchase order , but when i login from other user and open the similar purchase order the defaults fields are also seen including  above 4 fieds .
    Now my question is how to set the User choice fiels for the particular form that are common to all users.
    Means whenever i login in any user and opens the same document the same fields should be seen....Thanksssss.........

    You have to login with each and every user and do the Form Settings of every forms, so that all the forms look same for all the users.
    This is a manual job and you have do do it with every user login.
    Alternately, you can try out this link that explains
    [How to Copy One Screen Layout to Another User|http://www.sbonotes.com/2008/03/how-to-copy-one-screen-layout-to.html]

Maybe you are looking for

  • How to do this in Query Generator?

    Dear Experts, Please check my following query I've written in Query Generator. /* select from dbo.OCRD t0 */ declare @BP nvarchar(20) set @BP=/* t0.CardName */ '[%0]' declare @Dt1 datetime declare @Dt2 datetime set @Dt1=/* Start Date */ [%1] set Dt2=

  • IMac with multiple user accounts "cannot associate apple id for ....."

    I have an iMac with multiple user accounts each with an Apple ID and individual iTunes library and Itunes match linking to iPhones iPads etc. I bought songs on my iPhone yesterday, on trying to listen to them on the iMac (my user account) this mornin

  • Moved iTunes library to external drive

    NOTE: I have the most recent version of iTunes (as of 14 DEC 08). I moved my iTunes library to an external hard drive. The music videos I purchased shows an exclamation icon next to them. Is there a way I can reference all those videos to their new l

  • Dictionaries in staroffice 8

    Hi, I would like to add Greek support for spelling in staroffice 8 and although i followed the instructions i found i can't.To be more specific ... I found the following info, how to add dictionaries Please make sure that StarOffice is not running (i

  • Mac Mini Switch

    Hi, I currently have a iMac G4 flat panel. I am thinking of getting the intel mac mini. I have a few questions. 1. Can I replace OS 10.4 tiger with 10.3 panther because I have found that tiger does not suppost the internet connection I have qhich is