Give me Sql Query for this problem?.  Please Help Me........

This is my exact requirements
My PNO table formart is
PNO PDate PCount
P001 08/27/05 20
P001 08/29/05 10
P002 08/27/05 20
P003 08/28/05 20
P003 08/28/05 20
I want to display the total (PCount) PNumber for this week.
PNo Sat (27th) Sun(28th) Mon(29th) .........Fri(2/09/2005)
P001 20 0 10 0
P002 20 30 0 0
P003 0 40 0 0
or at least i want to display, i mean if there is no record for P003 on starturday, it will display 0.
PNo Sat (27th)
P001 20
P002 20
P003 0
first iam getting distinct PNo for this week, and check whether these number occurs on saturday if occur then display count otherwise display 0
Millons of thanks in advance...
Message was edited by:
user448874

EZECASH@ORCL> select * from pno_table;
PNO  PDATE         PCOUNT
P001 27-AUG-05         20
P001 29-AUG-05         10
P002 27-AUG-05         20
P003 28-AUG-05         20
P003 28-AUG-05         20
P001 02-SEP-05         10
P001 03-SEP-05         15
P002 03-SEP-05         10
P002 04-SEP-05         10
9 rows selected.
EZECASH@ORCL> select next_day(trunc(sysdate)-7,'sat') d1,next_day(trunc(sysdate)-7,'sat')+1 d2,next_day(trunc(sysdate)-7,'sat')+2 d3,
  2    next_day(trunc(sysdate)-7,'sat')+3 d4,next_day(trunc(sysdate)-7,'sat')+4 d5,next_day(trunc(sysdate)-7,'sat')+5 d6,
  3    next_day(trunc(sysdate)-7,'sat')+6 d7
  4  from dual
  5  /
D1        D2        D3        D4        D5        D6        D7
27-AUG-05 28-AUG-05 29-AUG-05 30-AUG-05 31-AUG-05 01-SEP-05 02-SEP-05
EZECASH@ORCL> select pno,sum(decode(trunc(pdate),d1,pcount,0)) day1Sum, sum(decode(trunc(pdate),d2,pcount,0)) day2Sum,
  2  sum(decode(trunc(pdate),d3,pcount,0)) day3Sum,sum(decode(trunc(pdate),d4,pcount,0)) day4Sum,
  3  sum(decode(trunc(pdate),d5,pcount,0)) day5Sum,sum(decode(trunc(pdate),d6,pcount,0)) day6Sum,
  4  sum(decode(trunc(pdate),d7,pcount,0)) day7Sum
  5  from  pno_table,
  6  (select next_day(trunc(sysdate)-7,'sat') d1,next_day(trunc(sysdate)-7,'sat')+1 d2,next_day(trunc(sysdate)-7,'sat')+2 d3,
  7    next_day(trunc(sysdate)-7,'sat')+3 d4,next_day(trunc(sysdate)-7,'sat')+4 d5,next_day(trunc(sysdate)-7,'sat')+5 d6,
  8    next_day(trunc(sysdate)-7,'sat')+6 d7
  9  from dual) w
10  where pdate >= next_day(trunc(sysdate)-7,'sat')
11  group by pno
12  /
PNO     DAY1SUM    DAY2SUM    DAY3SUM    DAY4SUM    DAY5SUM    DAY6SUM    DAY7SUM
P001         20          0         10          0          0          0         10
P002         20          0          0          0          0          0          0
P003          0         40          0          0          0          0          0
EZECASH@ORCL>

Similar Messages

  • Hi, sometimes big images could not open with photoshop.ı can open with windows but cant open photoshop.if ı try to open i am seeing a white image.is there any answer for this problem please.

    hi, sometimes big images could not open with photoshop.ı can open with windows but cant open photoshop.if ı try to open i am seeing a white image.is there any answer for this problem please.

    Just to assist those who might help you with this, please give the exact version of Photoshop CS6 you are running, for instance CS6 13.0.1.3.
    I had already asked for that in my previous post, but I guess you didn't quite know what I was referencing when I typed "exact version".
    Sorry, I cannot help you myself because I don't deal with that kind of 3D images, don't use Windows, and in all frankness I'm not quite following your last post.
    Also please give the exact model of your graphics card, so they can check whether it is on the list of cards tested by Adobe.
    Thank you.

  • Can anyone solve (or) give me a solution for this problem.....?

    Hi Everyone!
    Can anyone solve (or) give me a solution for this problem.....?
    We have used two folders Source & Finalwork. We have get image from Source folder and put silo path & Moved to Finalwork folder.
    Is this possible to check whether both folder images Embedded color profile same or not.
    -yajiv

    Could you elaborate what you mean by this
    We have get image from Source folder and put silo path & Moved to Finalwork folder.
    Possibly again with a screenshot to illustrate the task?
    // 2012, use it at your own risk;
    #target photoshop
    var theFolder = Folder.selectDialog ("select source folder");
    if (theFolder) {
    var theFiles = theFolder.getFiles(/\.(jpg|tif|eps|psd)$/i)
    var theOtherFolder = Folder.selectDialog ("select target folder");
    if (theOtherFolder) {
    var theOtherFiles = theOtherFolder.getFiles(/\.(jpg|tif|eps|psd)$/i)
    var missingFiles = new Array;
    var unmatchedProfiles = new Array;
    // work through files;
    for (var m = 0; m < theFiles.length; m++) {
              var check = false;
              var theFile = theFiles[m];
    // find name of the same name;
              for (var n = 0; n < theOtherFiles.length; n++) {
                        var theOtherFile = theOtherFiles[n];
    // if one is found;
                        if (theFile.name == theOtherFile.name) {
                                  check = true;
                                  var oneFile = app.open(File(theFile));
                                  var otherFile = app.open(File(theOtherFile));
    // check profiles;
                                  if (oneFile.colorProfileName == otherFile.colorProfileName) {
    // collect umages with unmatched profiles;
                                  else {unmatchedProfiles.push(theFile)};
    // collect missing files;
              if (check == false) {alert ("hahaha");missingFiles.push(theFile)}
    // alert of problems;
    if (unmatchedProfiles.length > 0) {
    alert ("the corresponding files for these do have a different color space:\n"+unmatchedProfiles.join("\n\n"));
    if (missingFiles.length > 0) {
    alert ("these files miss corresponding ones:\n"+missingFiles.join("\n\n"));
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(jpg|tif|psd|pdf|)$/i)) {
            return true

  • I want sql query for this output

    hi guys
    could u tell how can i write sql query for this out put
    i have one table like this
    ID ACCOUTID TAX
    1 1 A
    2 1 B
    3 2 C
    4 2 D
    5 3 E
    7 NULL F
    8 NULL G
    MY OUT PUT MUST BE LIKE THIS
    ID AID TAX
    2 1 A
    4 2 D
    7 NULL F
    8 NULL G
    HERE IN THIS OUTPUT I SHOULD HAVE
    MAXIMAM ID VALUE FOR A REPEATED AID VALUES
    AND
    THE ROWS AID VALUES IS NULL ALSO MUST PAPULATED IN THE OUTPUT.
    I KNOW ONE SOLUTION LIKE THIS
    SELECT MAX(ID),AID,TAX
    FROM TABLE T
    GROUP BY AID,TAX
    UNION ALL
    SELECT ID, AIC,TAX
    FROM TABLE T
    WHERE AID IS NULL;
    BUT I WANT SAME RESULT WITH OUT USING LOGICAL OPERATORS.
    COULD U PLZ TELL A SOL.

    Will this help:
    SQL> with t as
      2    (
      3      select 1 ID, 1 ACCOUTID, 'A' TAX from dual union all
      4      select 2, 1, 'B' from dual union all
      5      select 3, 2, 'C' from dual union all
      6      select 4, 2, 'D' from dual union all
      7      select 5, 3, 'E' from dual union all
      8      select 7, NULL, 'F' from dual union all
      9      select 8, NULL, 'G' from dual
    10    )
    11  --
    12  select id, ACCOUTID AID, Tax
    13  from
    14  (
    15    select t.*
    16          ,count(1)       over (partition by t.ACCOUTID) cn
    17          ,row_number()   over (partition by t.ACCOUTID order by id desc) rn
    18    from t
    19  )
    20  where cn > 1
    21  and (rn = 1 or ACCOUTID is null)
    22  /
            ID        AID T
             2          1 B
             4          2 D
             8            G
             7            F
    -- If I leave out the OR condition then you'll get this:
    SQL> ed
    Wrote file afiedt.buf
      1  with t as
      2    (
      3      select 1 ID, 1 ACCOUTID, 'A' TAX from dual union all
      4      select 2, 1, 'B' from dual union all
      5      select 3, 2, 'C' from dual union all
      6      select 4, 2, 'D' from dual union all
      7      select 5, 3, 'E' from dual union all
      8      select 7, NULL, 'F' from dual union all
      9      select 8, NULL, 'G' from dual
    10    )
    11  --
    12  select id, ACCOUTID AID, Tax
    13  from
    14  (
    15    select t.*
    16          ,count(1)       over (partition by t.ACCOUTID) cn
    17          ,row_number()   over (partition by t.ACCOUTID order by id desc) rn
    18    from t
    19  )
    20  where cn > 1
    21* and rn = 1
    SQL> /
            ID        AID T
             2          1 B
             4          2 D
             8            G
    --which follows the description you've given, but not the output

  • Ever since the last update, My iTunes continues to quit unexpectedly. It will open for one second and then close. Anyone have a solution for this. Please help.

    Ever since the last update, My iTunes continues to quit unexpectedly. It will open for one second and then close. Anyone have a solution for this. Please help.
    I've tried my best to troubleshoot. . . opening in safe mode nothing seems to work.
    In the problem report, this is the error that stood out:
    Crashed Thread:  8  Dispatch queue: com.apple.iad.iadidmanager
    Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000090

    Hi there navicin79,
    You may find the troubleshooting steps in the articles below helpful. The first thing I would try is reinstalling iTunes as outlined in the first article.
    Troubleshooting iTunes installation on Mac OS X
    http://support.apple.com/kb/ht2311
    OS X Mavericks: If an app freezes or quits unexpectedly
    http://support.apple.com/kb/PH13975
    -Griff W. 

  • My iphone 4 is acting like crap right i can't even restore it everytime i try to reboot it my iphone freezes at the apple logo it is ******* to the point where i just want to smash it how do i solve this problem please help?

    my iphone 4 is acting like crap right i can't even restore it everytime i try to reboot it my iphone freezes at the apple logo it is ******* me off to the point where i just want to smash it how do i solve this problem please help?

    Don't worry, just follow these steps to fix iPhone stuck on Apple logo
    => First of all Start your Computer and then connect with Internet connection, now Download the latest version of the iTunes application
    => Now install the iTunes application in your System and connect your Device with computer via Data cable
    => Now connect your Device with iTunes application and then Tab on summary option, see in the left side bar of iTunes
    => Now Select restore option from iTunes and then confirm the Restore Message for better results. After this unplug your Device and Restart it
    I hope that will surely
    Thank you...

  • Hi, Please tell me how can I send the Music Videos to the I Pod From the Computer, I'm so upset about this problem, Please help me ASAP.

    Hi, Please tell me how can I send the Music Videos to the I Pod From the Computer, I'm so upset about this problem, Please help me ASAP.

    Here:
    iTunes 11 for Mac: Set up syncing for iPod, iPhone, or iPad
    or
    iTunes 11 for Windows: Set up syncing for iPod, iPhone, or iPad

  • Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me

    Hi .. my iPad 4 with iso 7.0.3 he is restarting himself ... How can i solve this problem please help me

    Standard troubleshooting...
    1. Try a Restart by pressing the sleep/lock button until you see the slider.  Slide to power off.  Restart by pressing the sleep/lock button until you see the Apple logo.
    2. Try a Reset by pressing the home and sleep buttons until you see the Apple logo. Takes about 5-15 secs of button holding and you won't lose any data or settings.
    3. Remove apps from Recently Used list...
    - From any Home Screen, double tap the home button to bring up the Recents List
    - Swipe up on the app preview card to remove it from the list
    - Press the home button when done.
    4. If still a problem restore with your backup.
    5. If still a problem restore as new, i.e. without your backup. See how it runs with nothing synced to it.
    6. If still a problem, it's likely a hardware issue.

  • HT5622 my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    my apple id is not working when i sign in from my laptop it works but when i sign in from my iphone4 then its not working it gives the message of "your aapleid or password is incorrect"? how can i solve this problem please help

    Hey nocillado,
    Thanks for using Apple Support Communities.
    It sounds like you have 2 things you want to address. These articles can help you use iCloud with your existing Apple ID.
    Get help activating your iPhone
    http://support.apple.com/kb/ts3424
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Using the same Apple ID for Store purchases and iCloud (recommended)
    Have a nice day,
    Mario

  • Any one can plz give me the Solution for this problem

    select country ----text field
    select states ---------text field
    select country is one text field and select states is another text field .
    By using ajax if i select country like india states belonging to the india should be displayed in select states text field -----
    like if i select any country , belonging states should be displayed in selected states text field.
    can any one plz suggest me for this problem by using ajax with step by step solution.
    thanks in advance.....

    nareshannam wrote:
    can any one plz suggest me for this problem by using ajax with step by step solution.
    thanks in advance.....Well my Idea is to look for another Forum ,This is not a Ajax Forum
    maybe try [http://www.dynamicdrive.com/] or [http://www.webdeveloper.com/]

  • I have followed the instructions to delete the alot tool bar. It still appears. I'm thinking the only way for me to get rid of it is to Delete FireFox. Please give me a fix for this problem.

    I like Firefox but the fix to remove Alot tool bar doesn't work. If I remove Firefox Alot will disappear. I'd rather not do this. Please give me a fix that will work on my IMAC.
    Thanks

    Sounds like it's hardware issue. The iPhone warranty is based in the original country of purchase. Since it was bought in Korea you will need to ship the phone to someone you know in Korea to be taken in and then they will have to ship it back to you. The cost of shipping will be at your expense.

  • What is the sql query for this

    table Employee
    EmpId
    Name
    MonthlySalary
    DateofJoining
    Suggest  a sql server query to find out the employee details whose having salary greater than their yers of experiance 
    nravhad

    Hi ,
      As this seems to be a kind of lab exercise question for learning purpose , i am giving you the pseudo code which will help to solve this problem and learn.
      select <the requeired columns> from employee table.
      where Find the no of years between dateofjoining and current date using DATEDIFF function< monthly salary
      if this is not a lab exercise problem for learning purpose , please forgive my ignorance.
    Best Regards Sorna

  • What can be the SQL Query for this requirement ?

    Hi,
    I have a table with fields like this:
    ID DESC PARENT
    01 ABC 02
    02 ABC1 01
    03 ABC2 01
    04 ABC4 02
    In the above table PARENT column refers to ID column , but actually in SQL query i want to have ID, DESC , and PARENTDESC (i.e., desc value of the corresponding ID)
    Actual output that i need is
    select ID , DESC , ?? from table where ID=someValue . Now if i provide ID=01 then output should be like this:
    ID DESC PARDESC
    01 ABC ABC1
    Can anyone help what can be the required sql query ?
    Edited by: bootstrap on Apr 29, 2011 6:15 AM

    SELECT T1.ID, T1.DESC, T2.DESC
    FROM TABLEA T1, TABLEA T2
    WHERE T1.ID='01'
    AND T2.ID = T1.PARENT;

  • HT1871 Hi. my iphone 4 is getting heated and battery is getting lower & lower. since last 4 days i am facing this problem. please help me

    Dear Team,
    Since last 4 days after i have replaced display of my iphone 4, my handset is getting heated & battery is getting discharged in no time. i mean in morning i am doing full charge & before noon its getting low.
    please help
    Ravi Vyas

    Will it get rectified and restored...if so after how long. What could be the reason for such outage kindly share,  as I am facing real problem because of this...

  • Got dizzy with this problem,please help!

    I am trying to write a simple pagingGrid component,but i don't know why when i click next page icon,it still show the first page. i wrote a scroller component ,its renderer and a scroller tag.The paging process is like this, taking "next" action for example, and please be patient:
    Step 1 i click the "next" icon, in the renderer it is rendered like this:
    String clientId = component.getClientId(context);
             String formId=RendererUtil.getFormId(context,component);
             ScrollerAction scrollerAction=TagUtil.getCurrentScrollerAction();
             String path="http://localhost:8080/JSFOnStart/index.faces";
             scrollerAction.setClientID(clientId);
             scrollerAction.setFormID(formId);
             String imagePath="next.gif";
              writer.startElement("a", component);
             writer.writeAttribute("href", path, null);
             writer.writeAttribute("onclick",
                      // submit form in which the scroller resides
                       "document.forms['" + formId + "'].submit(); ", null);
             writer.startElement("img",component);
             writer.writeAttribute("src",imagePath,null);
             writer.endElement("img");
             writer.endElement("a");
             scrollerAction.setAction("next");The scrollerAction is a managed bean of ScrollerAction class with the session scope.I think I could share information between components by storing the info in session scoped managed bean,and every time i need it, i use the following code to get the instance:
    public static ScrollerAction getCurrentScrollerAction()
                   FacesContext context=FacesContext.getCurrentInstance();
                   Application app=context.getApplication();
                   VariableResolver vr=app.getVariableResolver();
                   ScrollerAction scroller=(ScrollerAction)vr.resolveVariable(context,"scrollerAction");     
                  return scroller;
              }I think during the session,i will always get the same instance no matter in which component i invoke the above method,maybe some problem with this?
    Step 2: In the setProperties(..) method of PagingGridTag class, i get the ScrollerAction instance with the above getCurrentScrollerAction() method,and in the very similar way, i got a PagingParam instance which is also a session scoped managed bean and it stores the information like currentPage, totalPages and so on. By using the two instances, I got the action value and infos like current page and total page count.Based on these information, i do some calculation to set the value of current page,rows to be displayed,start row index and so on, the calculation is simple and i am sure it is right.The corresponding component is HtmlPagingGrid which is a subclass of HtmlDataTable, and i can set the "rowIndex" and "rows" of it to do paging.
    But i don't know why it is not working well when i click the "next" icon.
    Maybe it is one of such problems below or some other problems:
    1 the javascript part is not right, i only use one page "index.jsp" to test it out.
    2 everytime i try to get ScrollerAction and PagingParams instances,actually i got a new instances, so the informations are always for the first page.
    The whole thing seems not complex,but i got really dizzy with it, and if you are interested in this topic and want to have the code to check the problem out, please send an email to me,mine is [email protected], then i will reply your email with my code attached.Thanks:)
    Best Regards:)
    Robin

    *i deleted all my music on itunes to free up disc space on my pc.*
    Why not leave it on the external drive and let iTunes use that for all your music?
    *as i manually manage my itunes so as not to reload my music in a file*
    I have no idea what this means.
    I autosync my iPod with selected playlists.
    Only new songs get loaded onto the iPod and old songs get taken off. It doesn't reload everything.
    If yopu cannot find the podcasts on the iPod to delete them, you will need to restore the iPod.

Maybe you are looking for