How to resolve this query ?

Guys,
How do i get the below output ?
I have the following data
12/6/2008     EGG     
12/6/2008     CHICKEN
12/6/2008     LAMB
13/6/2008     LAMB
13/6/2008     LAMB
13/6/2008     LAMB
14/6/2008     EGG
14/6/2008     EGG
14/6/2008     CHICKEN
14/6/2008     LAMB
I need out out something like this
          EGG     CHICKEN           LAMB
12/6/2008     1     1          1
13/6/2008     3     0          0
14/6/2008     2     1          1Thanks in advance

ME_XE?with data as
  2  (
  3     select to_date('12/6/2008','dd/mm/yyyy') as col1, 'EGG' as col2 from dual union all
  4     select to_date('12/6/2008','dd/mm/yyyy') as col1, 'CHICKEN' as col2 from dual union all
  5     select to_date('12/6/2008','dd/mm/yyyy') as col1, 'LAMB' as col2 from dual union all
  6     select to_date('13/6/2008','dd/mm/yyyy') as col1, 'LAMB' as col2 from dual union all
  7     select to_date('13/6/2008','dd/mm/yyyy') as col1, 'LAMB' as col2 from dual union all
  8     select to_date('13/6/2008','dd/mm/yyyy') as col1, 'LAMB' as col2 from dual union all
  9     select to_date('14/6/2008','dd/mm/yyyy') as col1, 'EGG' as col2 from dual union all
10     select to_date('14/6/2008','dd/mm/yyyy') as col1, 'EGG' as col2 from dual union all
11     select to_date('14/6/2008','dd/mm/yyyy') as col1, 'CHICKEN' as col2 from dual union all
12     select to_date('14/6/2008','dd/mm/yyyy') as col1, 'LAMB' as col2 from dual
13  )
14  select
15     col1,
16     count(decode(col2, 'EGG', 1, NULL))       AS EGG_COUNT,
17     count(decode(col2, 'CHICKEN', 1, NULL))   AS CHICKEN_COUNT,
18     count(decode(col2, 'LAMB', 1, NULL))      AS LAMB_COUNT
19  from data
20  group by col1;
COL1                                EGG_COUNT      CHICKEN_COUNT         LAMB_COUNT
13-JUN-2008 12 00:00                        0                  0                  3
14-JUN-2008 12 00:00                        2                  1                  1
12-JUN-2008 12 00:00                        1                  1                  1
3 rows selected.
Elapsed: 00:00:00.03

Similar Messages

  • How to resolve this Error ORA-04030: out of process memory when trying to a

    Hi
    I am connecting as a sysdba and trying to execute a query on the V$Logmnr_contents but getting the following Error
    ORA-04030: out of process memory when trying to allocate 408 bytes (T-LCR
    structs,krvuinl_InitNewLcr)
    Can anyone guide me how to resolve this issue.
    Thanks

    Hi,
    As root user, edit the /etc/sysconfigtab file, and try to set the udp_recvspace parameter to 262144 and reboot the machine :
    inet:
    udp_recvspace = 262144
    Metalink note 297030.1 Ora-04030 During Execution Of LogMiner Query
    Nicolas.

  • How to combine this query so that i can display the ouput together

    I have no idea how to combine this query together.Someone please help.I want the ouput to display oni 1 result combining all together.
    select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in ('6910','7976') AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in ('6912','7976') AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in ('7344','7976') AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in ('8344','7976') AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    Edited by: 965547 on Nov 5, 2012 12:55 AM

    The only difference which i am seeing in your queries is the Operation ('6910', '6912','7344','8344')
    Then why don't you put all values in One like this
    Select facility, route, operation, script_id
    from F_ROUTEOPER
    where facility = 'A01' and operation in *('6910', '6912','7344','8344','7976')* AND src_erase_date is null
    and (script_id not in ('PHQ-LOTCHKRV','PHQ-LOTCHK') or script_id is null)
    AND (route NOT LIKE '9EL%' AND route NOT LIKE '9TB%'AND route NOT LIKE 'BLB%' AND route NOT LIKE 'BWR%' AND route NOT LIKE 'CRL%')
    Hope this will resolve your problem.
    Oracle-911

  • I bought an I pad 2 from us but I can not activate the Facetime in UAE(Dubai)as I can not see the country in the I pad's  drop list, anyone has an idea as how to resolve this issue

    I bought an I pad 2 from us but I can not activate the Facetime in UAE(Dubai)as I can not see the country in the I pad's  drop list, anyone has an idea as to how to resolve this issue

    I'm not that familiar with how FaceTime works. I know how to set It up but I don't use it. I just know that you can't activate in the UAE. I believe that you can activate in any country that permits it's use. Whether you will need a new ID or not, I can't confirm.
    You can Google this and get all sorts of articles on workarounds. Apparently if you set up a VPN you can use it in the UAE. Here is one article that I found.
    http://talkfree7.blogspot.com/2010/09/how-to-facetime-voip-call-from-uae.html
    I Googled "workaround for FaceTime in UAE" to find this.

  • When i login to MES operator resp..i get a error saying...You must setup an HR employee for this Oracle Application user...how to resolve this?

    when i login to MES operator resp..i get a error saying...You must setup an HR employee for this Oracle Application user...how to resolve this?

    Hey everyone in Apple world!
    I figured out how to fix the flashing yellow screen problem that I've been having on my MBP!  Yessssss!!!
    I found this super handy website with the golden answer: http://support.apple.com/kb/HT1379
    I followed the instructions on this page and here's what I did:
    Resetting NVRAM / PRAM
    Shut down your Mac.
    Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    Turn on the computer.
    Press and hold the Command-Option-P-R keys before the gray screen appears.
    Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    Release the keys.
    I went through the 6 steps above twice, just to make sure I got rid of whatever stuff was holding up my bootup process.  Since I did that, my MBP boots up just like normal.  No flashing yellow screen anymore!!   
    (Note that I arrived at this solution when I first saw this page: http://support.apple.com/kb/TS2570?viewlocale=en_US)
    Let me know if this works for you!
    Elaine

  • I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    I am having problems with the Preview application.  When I try to use it to open a pdf document it gets hung-up and I have to select force quit to close it.   Any ideas on how to resolve this problem?  Thanks for any help

    Can you open the Preview program without loading a file, like by itself?
    If it doesn't load then I suspect a corrupt Preview preference file.
    Deleting the System Preference or other .plist file
    Can you open other files with Preview, like jpg's and images?
    How about other PDFs? or is it just that one you have downloaded?
    Run through this list of fixes
    Step by Step to fix your Mac

  • How to resolve this issue??

    I have given box / borders for cells in the table in smartforms. in main window.
    Now when i print with HPlaser the output comes fine.
    But when i use Epson - The borders almost print 5 to 6 times bigger & looks to ugly and even the data is not shown. Meaning the data is overshadowed by the borders of the Cells.
    Tried to reduce the <b>width</b> in the BOX option of TABLE in smartforms. By default it is 15.00 TW.  did not work.
    EPSON is what they want to use.
    Please let me know how to resolve this issue.
    Regards,
    Siva

    Hi Siva,
    Ask them to provide the Diamension of what paper type they
    are using for EPSON, becoz U might have kept paper size
    as A4 and there they might be using INCH12 or some other size
    of paper( not Sure ).So if u can have the Exact paper format that
    they are going to use , u can design ur form in that paper format
    and then check.
    Regards
    Avi.....

  • After upgrading to iOS 5, my iPhone 4 takes a very long time to open digitally signed emails. I've tried with the SMIME settings enabled, but that doesn't help either. Any ideas on how to resolve this?  Thanks in advance.

    After upgrading to iOS 5, my iPhone 4 takes a very long time to open digitally signed emails. I've tried with the SMIME settings enabled, but that doesn't help either. Any ideas on how to resolve this?  Thanks in advance.

    I suspect you may have a corrupt photo or image that is causing the sync to fail or quit. You might want to try removing all of your photos by deselecting them in iTunes then sync - and try adding them by each sub-folders until you are able to nail down which sub-folder of photos, that causes the sync to stop or gives you errors.

  • I am no longer able to double click on a file and have it open.  Any suggestions on how to resolve this problem?

    I am no longer able to double click on a file and have it open.  Any suggestions on how to resolve this problem?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • My hard drive on my MacBook Pro stopped working and I had to replace the hard drive.  I cannot get my playlists and photos to appear in my iTunes and iPhoto.  Does anyone know how to resolve this?

    My hard drive on my MacBook Pro stopped working and I had to replace the hard drive.  I cannot get my playlists and photos to appear in my iTunes and iPhoto.  Does anyone know how to resolve this?

    Peace Lilly wrote:
    ...  Will I loose everything if I connect the iphone to the itunes as a new device?
    To avoid that...
    See these 2 Links...
    Syncing to a New Computer...
    https://discussions.apple.com/docs/DOC-3141
    Recovering your iTunes library from your iPod or iOS device
    https://discussions.apple.com/docs/DOC-3991

  • I've problem with Game Center . I can't sign in Game Center on my iPad . I tap on the Game Center icon but the page is blank. I tried go to setting, my Apple ID appear but the page keep on loading and  nothing pop up. How to resolve this issue?

    I've problem with Game Center . I can't sign in Game Center on my iPad . I tap on the Game Center icon but the page is blank. I tried go to setting, my Apple ID appear but the page keep on loading and  nothing pop up. How to resolve this issue?

    Hi, bamboo64. 
    Try closing all open applications in multitasking and power cycling the device.  Once this is done test the results.  If the issue persists, I have included a couple troubleshooting articles that I would recommend going through. 
    iOS: Force an app to close
    http://support.apple.com/kb/ht5137
    Troubleshoot issues on an iPhone, iPad, or iPod touch
    If you haven't been able to connect to the iTunes Store:
    Make sure your date, time, and time zone are correct in Settings > General > Date & Time.
    Note: Time Zone may list another city in your time zone.
    Make sure that your iOS software is up to date by tapping Settings > General > Software Update (iOS 5 or later) or connecting your iOS device to iTunes and clicking Check for Update on your device's Summary page.
    Check and verify that you're in range of a Wi-Fi router or base station. If you're on a device with cellular service, make sure that cellular data is turned on from Settings > General > Cellular.
    Note: If connected to cellular data, larger items may not download. You may need to connect to Wi-Fi to download apps, videos, and podcasts.
    Make sure that you have an active Internet connection. You can check the user guide for your device for help with connecting to the Internet.
    Make sure that other devices (portable computers, for example) are able to connect to the Wi-Fi network and access the Internet.
    Try resetting (turning off and then on again) your Wi-Fi router.
    If the issue persists, try troubleshooting your Wi-Fi networks and connections.
    Can't connect to the iTunes Store
    http://support.apple.com/kb/ts1368
    Cheers,
    Jason H. 

  • I have one iPhone 4s, one iPad 2 and wife's iPhone 4s. yesterday I have updated all with ISO 8 under one apple id, now my problem is that in same WiFi when Any of phone receive phone all the three gazettes ring simultaneously . how to resolve this.

    I have one iPhone 4s, one iPad 2 and wife's iPhone 4s. yesterday I have updated all with ISO 8 under one apple id, now my problem is that in same WiFi when Any of phone receive phone all the three gazettes ring simultaneously . how to resolve this.
    regards
    rbv

    Tell your wife to get her own Apple ID. If you do not want continuity/handoff to work with calls, on both devicesgo to Settings==>>FaceTime==>> Turn OFF iPhone cellular calls.

  • How to use this query in R12

    the query below , i am using in valueset :
    select * from AR_LOCATION_VALUES
    Where ar_location_values.location_segment_qualifier =
    'COUNTRY' and ar_location_values.location_structure_id in ( select location_structure_id from ar_system_parameters )
    how to use this query to set in R12?
    Thanks

    hi
    i am using the following query in 11i and i want to use the same in R12 :
    SELECT ar_location_values.location_segment_description,ar_location_values.location_segment_value,location_segment_id
    FROM AR_LOCATION_VALUES
    WHERE ar_location_values.location_segment_qualifier = 'COUNTRY'
    AND ar_location_values.location_structure_id IN
    (SELECT location_structure_id FROM ar_system_parameters)
    note: the table ar_location_values is obsolette in R12 so what is the replacement table in R12 for this?

  • How to Resolve this Error comming in SMP2.3 HWC?

    Hi Experts,
    20140605T150459.418|1|MyDynamicChart:1 -- Request: <M><H></H><S>Start</S><A>GetCustomData</A><VS><V k="Port_et_key" t="T">1433</V><V k="User_Name_et_key" t="T">sup</V><V k="Password_et_key" t="T">123</V><V k="Vertical_Column_et_key" t="T">sal</V><V k="No_of_Rows_wt_key" t="T">7</V><V k="Horizontal_Column_et_key" t="T">name</V><V k="Database_Name_et_key" t="T">sup</V><V k="Ipaddress_et_key" t="T">192.168.1.7</V><V k="Table_Name_et_key" t="T">emp</V><V k="ErrorLogs" t="L" /></VS></M>
    20140605T150459.418|1|MyDynamicChart:1 -- ResponseHeader: {"id":"a4af2a9cbf7c48f8a06c2c46a977fefc","cid":"46#MyDynamicChart:1","pv":"3","sig":"94f82e26311448c1901e444c7c7f475e","loginFailed":false,"method":"searchFailed","log":"[{\"_op\":\"N\",\"level\":\"ERROR\",\"code\":404,\"eisCode\":\"400\",\"message\":\"com.sybase.dataservices.DSException:HTTP status code is [400], expected [200]; response body is []\",\"component\":\"Newconnection_driverName_com_microsoft_sqlserver_jdbc_SQLServerD\",\"entityKey\":null,\"operation\":\"search\",\"requestId\":\"a4af2a9cbf7c48f8a06c2c46a977fefc\",\"timestamp\":\"2014-06-05 09:34:59.366\",\"messageId\":610003,\"_rc\":0}]","mbo":"Newconnection_driverName_com_microsoft_sqlserver_jdbc_SQLServerD","app":"MyDynamicChart:1","pkg":"dynamicdbchart:1.0"}
    20140605T150946.650|3|Mychart:1 -- loading meta data from: C:\SAP\MobilePlatform\Servers\MessagingServer\Bin\Mobile Workflow\456_1\workflowclient.xml
    20140605T150946.810|3|Mychart:1 -- loading meta data for screen: Start and action: Login
    20140605T150946.912|3|Mychart:1 -- executing operation 'LoginQuery' of type 'search' on mbo 'ChartLogin' in package 'chart:1.0'
    20140605T150946.920|3|Mychart:1 -- using username and password value from server context variables.
    I am using a Rest Web Service, which takes input.
    the service is working fine in the browser and Rest Client, but when I am calling this MBO, it is generating the above error.
    How is this error comming?
    How to Resolve this?
    Regards,
    Sravanya.

    Hello Midhun,
        Yes, that is a data type problem. In my service is taking the noofrows in "INT" format.
    This is my service,
    /newconnection?noOfRows={noofrows}
    when i created the MBO with this service it is taking the datatype of the "noofrows" in string format.
    how to change that datatype to INT type?
    Sravanya.

  • I updated my itunes this morning, and now I keep getting an error message when trying to burn a disc. Any ideas how to resolve this?

    I updated my itunes this morning, and now I keep getting an error message when trying to burn a disc. Any ideas how to resolve this?

    Go to Control Panel > Add or Remove Programs (Win XP) or Programs and Features (later)
    Remove all of these items in the following order:
    iTunes
    Apple Software Update
    Apple Mobile Device Support (if this won't uninstall move on to the next item)
    Bonjour
    Apple Application Support
    Reboot, download iTunes, then reinstall, either using an account with administrative rights, or right-clicking the downloaded installer and selecting Run as Administrator.
    The uninstall and reinstall process will preserve your iTunes library and settings, but ideally you would back up the library and your other important personal documents and data on a regular basis. See this user tip for a suggested technique.
    Please note:
    Some users may need to follow all the steps in whichever of the following support documents applies to their system. These include some additional manual file and folder deletions not mentioned above.
    HT1925: Removing and Reinstalling iTunes for Windows XP
    HT1923: Removing and reinstalling iTunes for Windows Vista, Windows 7, or Windows 8
    tt2

Maybe you are looking for

  • Should be a page or group on Facebook for Wiki Ninjas

    Hi, I posted this on this blog several days ago, and mentioned it at the forum as well. But the right place should be in this forum probably :-) SO here it is: Should be a page or group on Facebook, like the twitter in the "Engage" section. I for exa

  • How to start Indesign with JS

    To start Indesign and create a new document with VBS I use this code: Set myInDesign = CreateObject("InDesign.Application.CS3") Set myDocument = myInDesign.Documents.Add With JS the second line will be: var myDocument = app.documents.add(); but how I

  • ARD has no windows or menus after migration

    After using Migration Assistant to move from a MBP Core 2 Duo machine to a MBP i7 machine, ARD opens with no windows and all the menus are grayed out. Usually when I migrate, ARD asks to have the serial number reentered but there was no request or op

  • Debugging the webdynpro abap application from portal.

    I  developed a  WebDynpro  application and integrated in portal. I have to catch some portal events.For that i have written some code in my application. I tried to debug the application from portal  by using all the available break-point types.but we

  • Homepage templates in iweb?

    I like some of the Homepage templates and I don't much like the IWEB ones. Any way to get the homepage templates into iweb?? Thanks. Bea