WHERE DATE QUERY Problem. Need Help.

Hi, I have a problem doing a query on the clause where. I want to filter all the data on my table with a date filtering, I just want to show all the data with Date bigger than where specification.
This is what I do.
Select * from Table where DateLocal>'2007/01/01'
But it shows and error: ORA-01861: literal does not match format string
On my table the DateLocal is on this way: dd/mm/yyyy HH24:MI:SS, why I can't filtering by this date format yyyy/mm/dd???
The fact is my application works with mysql too, and I don't want to broke this sintax. Select * from Table where DateLocal>yyyy/mm/dd
What could I do??
Thanks.

Thanks that was one of my possibilities but the fact is I don't want to change all the code on my applicacion and make a case of for each data base, remember I can connect through the same application to oracle or mysql.
I think there is not more solutions.
Thanks anyway!

Similar Messages

  • Query problem - need help

    Hi everyone,
    I need some help from you because before I update my View Object I need to know one value using a Query like this: SELECT cp FROM cpostais WHERE cp4=1234 AND cp3 = 123. The result of the Query I need to save it on a variable (let's call CP) so I can use it to update my View Object. Something like this: currentRow.setAttribute("CPostal", CP);
    I'm using JDeveloper 10.1.2, struts and UIX pages.
    Can anyone tell me how can I do this? I need an example or a tutorial.
    This is really importante, can anyone help me??
    Thanks,
    Atena
    Message was edited by:
    Atena

    I tried to use something like this:
    ViewObject thirdView = daContext.getBindingContext().getDefaultDataControl().getApplicationModule().findViewObject("S2CodigosPostaisView1");
    thirdView.setWhereClauseParam(0, currentRow1.getAttribute("Localidade"));
    thirdView.setWhereClauseParam(1, currentRow1.getAttribute("Cp"));
    thirdView.setWhereClauseParam(2, currentRow1.getAttribute("Ext"));
    thirdView.executeQuery();
    Row currentRow3 = thirdView.getCurrentRow();
    currentRow3.getAttribute("Id");
    But this is not working. :(
    Can anyone help me with this????
    Thanks,
    Atena
    Message was edited by:
    Atena

  • Select Query Problem-need help

    hi,
    Help me out from this problem.
    Actually i have a table and the data in it as follows:
    Department Name Job Name
    Accounts Sr. Accountant
    Accounts Jr. Accountant
    Accounts Cleark
    But i dont want the repeated Department Name.. and i want the same output as follows.
    Department Name Job Name
    Accounts Sr. Accountant
    Jr. Accountant
    Cleark
    Without using sql reports and Sql Plus additional commands.
    The same output should come from a sql query only.
    Thanks in Advance
    Md Anwer Ali

    I shouldn't try to code before I have had at least three cups of coffee. The actual answer is:
    select decode(department,lag(department) over (order by department),null,department)
    , job
    from departments
    order by department.
    I ran this:
    select decode(job,lag(job) over (order by job),null,job)
    , ename
    from emp
    order by job
    and got this result:
    SQL> /
    DECODE(JO ENAME
    ANALYST SCOTT
    FORD
    CLERK SMITH
    ADAMS
    MILLER
    JAMES
    MANAGER JONES
    CLARK
    BLAKE
    PRESIDENT KING
    SALESMAN ALLEN
    MARTIN
    TURNER
    WARD
    14 rows selected.

  • Still stuck with the same old producer consumer weight problem need help

    Hello All,
    This is the problem I am stuck with right now.
    I have two array lists one producer array list and one consumer array list denoted by a and b
    P1 P2 P3 P4 P5
    5 6 7 8 9
    C1 C2 C3 C4 C5
    2 3 4 5 6
    Now we find all those producer consumer pairs which satisfy the criteria Pi>=Ci
    We have the following sets
    (5,2)(6,2)(7,2),(8,2),(9,2)
    (5,3)(6,3)(7,3),(8,3),(9,3)
    (5,4)(6,4)(7,4),(8,4),(9,4)
    (5,5)(6,5)(7,5),(8,5),(9,5)
    (6,6)(7,6)(8,6),(9,6)
    Let us done each of them with Si
    so we have S1,S2,S3,S4,S5
    we assign a third parameter called weight to each element in Si which has satisfied the condition Pi>=Ci;
    so we we will have
    (5,2,ai),(6,2,bi),(7,2,ci)....etc for S1
    similarly for S2 and so on.
    We need to find in each set Si the the pair which has the smallest weight.
    if we have (5,2,3) and (6,2,4) then 5,2,3 should be chosen.We should make sure that there is only one pair in every set which is finally chosen on the basis of weight.
    Suppose we get a pair (5,2,3) in S1 and (5,2,3) in S2 we should see that (5,2,3) is not used to compare to compare with any other elements in the same set S2,
    Finally we should arrive at the best element pair in each set.They should be non repeating in other sets.
    Given a problem
    P0 P1 P2 P3 P4
    9 5 2 2 8
    6 5 4 5 3
    C0 C1 C2 C3 C4
    we have So as (P0,C0) and (P4,C0)
    assuming that the one with the smaller index has lesser weight PO is selected.In the program I have used random weights.from set S1 we select the pair PO,CO
    S1 =(P0,C1),(P1,C1) and (P4,C1)
    since P0 and P4 are already used in previous set we dont use them for checking in S1 so we have (P1,C1) as best.
    S2=(P0,C2),(P1,C2) and (P4,C2) so we dont use P0,C2 and P1 and C2 because PO and P1 are already used in S1.
    So we choose P4,C2
    in S3 and S4 ae have (P0,C3),(P1,C3),(P4,C3) so we dont choose anything
    and same in S4 also.
    So answer is
    (P0,C0),(P1,C1) and (P4,C2).
    My program is trying to assign weights and I am trying to print the weights along with the sets.It doesnt work fine.I need help to write this program to do this.
    Thanks.
    Regards.
    NP
    What I have tried till now.
    I have one more question could you help me with this.
    I have an array list of this form.
    package mypackage1;
    import java.util.*;
    public class DD
    private  int P;
    private  int C;
    private int weight;
    public void set_p(int P1)
    P=P1;
    public void set_c(int C1)
    C=C1;
    public void set_weight(int W1)
    weight=W1;
    public int get_p()
    return P;
    public int get_c()
    return C;
    public int get_x()
    return weight;
    public static void main(String args[])
    ArrayList a=new ArrayList();
    ArrayList min_weights_int=new ArrayList();
    ArrayList rows=new ArrayList();
    ArrayList temp=new ArrayList();
    Hashtable h=new Hashtable();
    String v;
    int o=0;
    DD[] d=new DD[5];
    for(int i=0;i<4;i++)
    d=new DD();
    for(int i=0;i<4;i++)
    d[i].set_p(((int)(StrictMath.random()*10 + 1)));
    d[i].set_c((int)(StrictMath.random()*10 + 1));
    d[i].set_weight(0);
    System.out.println("Producers");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_p());
    System.out.println("Consumers");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_c());
    System.out.println("Weights");
    for(int i=0;i<4;i++)
    System.out.println(d[i].get_x());
    for(int i=0;i<4;i++ )
    int bi =d[i].get_c();
    ArrayList row=new ArrayList();
    for(int j=0;j<4;j++)
    if( d[j].get_p() >=bi)
    d[j].set_weight((int)(StrictMath.random()*10 + 1));
    row.add("(" + bi + "," + d[j].get_p() + "," +d[j].get_x() + ")");
    else
    d[j].set_weight(0);
    row.add("null");
    rows.add(row);
    System.out.println(rows);
    int f=0;
    for(Iterator p=rows.iterator();p.hasNext();)
    temp=(ArrayList)p.next();
    String S="S" +f;
    h.put(S,temp);
    String tt=new String();
    for(int j=0;j<4;j++)
    if(temp.get(j).toString() !="null")
    // System.out.println("In if loop");
    //System.out.println(temp.get(j).toString());
    String l=temp.get(j).toString();
    System.out.println(l);
    //System.out.println("Comma matches" + l.lastIndexOf(","));
    //System.out.println(min_weights);
    f++;
    for(Enumeration e=h.keys();e.hasMoreElements();)
    //System.out.println("I am here");
    int ii=0;
    int smallest=0;
    String key=(String)e.nextElement();
    System.out.println("key=" + key);
    temp=(ArrayList)h.get(key);
    System.out.println("Array List" + temp);
    for( int j=0;j<4;j++)
    String l=(temp.get(j).toString());
    if(l!="null")
    System.out.println("l=" +l);
    [\code]

    In your example you selected the pair with the greatest
    distance from the first set, and the pair with the least
    distance from the second. I don't see how the distance
    function was used.
    Also it's not clear to me that there is always a solution,
    and, if there is, whether consistently choosing the
    furthest or the closest pairs will always work.
    The most obvious approach is to systematically try
    all possibilities until the answer is reached, or there
    are no possibilities left. This means backtracking whenever
    a point is reached where you cannot continue. In this case
    backtrack one step and try another possibility at this
    step. After all possible choices of the previous step,
    backtrack one more step and so on.
    This seems rather involved, and it probably is.
    Interestingly, if you know Prolog, it is ridiculously
    easy because Prolog does all the backtracking for you.
    In Java, you can implement the algorithm in much the same
    way as Prolog implementations do it--keep a list of all the
    choice points and work through them until success or there
    are none left.
    If you do know Prolog, you could generate lots of random
    problems and see if there is always a solution.

  • Date query problem

    Hi,
    On a report I'm trying to do a date query:
    select * from table v
    where ..........
    and ( to_date(v.fecha_inicio, 'dd/mm/yyyy')
    between nvl(to_date(:P_BEGIN, 'dd/mm/yyyy'),
    to_date('01/01/0001', 'dd/mm/yyyy'))
    and nvl(to_date(:P_END, 'dd/mm/yyyy'),
    to_date('31/12/9999', 'dd/mm/yyyy')) )
    and could not get the right data (return no rows), I though it was a problem with my itmes so changed the item reference for the actual values:
    select * from table v
    where ..........
    and ( to_date(v.begin_date, 'dd/mm/yyyy')
    between nvl(to_date('01/10/2006', 'dd/mm/yyyy'),
    to_date('01/01/0001', 'dd/mm/yyyy'))
    and nvl(to_date('31/10/2006', 'dd/mm/yyyy'),
    to_date('31/12/9999', 'dd/mm/yyyy')) )
    and the result is the same.
    If change to
    and (to_char(v.fecha_inicio, 'dd/mm/yyyy')
    between nvl(to_date('01/10/2006', 'dd/mm/yyyy'), to_date('01/01/0001', 'dd/mm/yyyy') )
    and nvl(to_date('31/10/2006', 'dd/mm/yyyy'), to_date('31/12/9999', 'dd/mm/yyyy') ) )
    Sends a not a valid month error but if run the same query on sqldeveloper it works right.
    My question is why I could not get the right data on apex ?
    Thanks you

    I made the changes and is the same thing, no rows returned. If I try to evaluate between or > < is the same.
    I tried
    AND (to_char(v.fecha_inicio, 'yyyy') = '2006' )
    AND (to_char(v.fecha_inicio, 'mm') = '11' )
    And is the only thing I found that works !!!
    So I'm thinking to change my conditions so select a month and year to show. Don't think my user will be happy but for the moment ......
    Thanks

  • Date/time-operations - need help

    Hi there,
    I have a simple question but i don't have really good ideas to solve the problem with ABAP.
    This is the situation in which I need help:
    I have many date/time-pairs (every in a single variable of type d and t). Now I want to compare one date/time-pair with a given date (also as pair). This will give a time difference between the two dates.
    After that I want that all other date/time-pairs are shifted by this time difference (can be + and -).
    So now my solution yet:
    * FORM for calculation the time difference between 2 dates
    FORM idoc_compare_dates  USING    iv_date_orig
                                      iv_time_orig
                                      iv_date_new
                                      iv_time_new
                             CHANGING cv_diff       TYPE p.
      DATA: lv_timestamp_orig    TYPE timestamp,
            lv_timestamp_new     TYPE timestamp.
    * Creating timestamps for comparison
      CONVERT DATE iv_date_orig TIME iv_time_orig
        INTO TIME STAMP lv_timestamp_orig TIME ZONE sy-zonlo.
      CONVERT DATE iv_date_new TIME iv_time_new
        INTO TIME STAMP lv_timestamp_new TIME ZONE sy-zonlo.
    * Calculation the time difference
      cv_diff = lv_timestamp_new - lv_timestamp_orig.
    ENDFORM.                    " IDOC_COMPARE_DATES
    * FORM for shifting a date by the time period calculated in the first FORM
    FORM idoc_calc_single_date  USING    iv_diff      TYPE p
                                         iv_date_orig
                                         iv_time_orig
                                CHANGING cv_date_new
                                         cv_time_new.
      DATA: lv_timestamp_orig   TYPE timestamp,
            lv_timestamp_new    TYPE timestamp.
    * Creating a timestamp for the original date
      CONVERT DATE iv_date_orig TIME iv_time_orig
        INTO TIME STAMP lv_timestamp_orig TIME ZONE sy-zonlo.
    * Shifting the date
      lv_timestamp_new = lv_timestamp_orig + iv_diff.
    * Creating the new date into the output-variables
      CONVERT TIME STAMP lv_timestamp_new TIME ZONE sy-zonlo
        INTO DATE cv_date_new TIME cv_time_new.
    ENDFORM.                    " IDOC_CALC_SINGLE_DATE
    I am not sure if this coding above is really correct. Can you please check it? Perhaps you have also other ideas to solve this problem?
    Thank you!!
    Kind regards

    Thank you for your answers. Now I've created a small dummy-report, that tests the logic. And I think it seems to be okay.
    You can also check it if you want to with this small report:
    REPORT  zjz_test_timediff.
    PARAMETERS: p_dat1  TYPE sydatum DEFAULT sy-datum,
                p_zei1  TYPE syuzeit DEFAULT sy-uzeit,
                p_dat2  TYPE sydatum DEFAULT sy-datum,
                p_zei2  TYPE syuzeit DEFAULT sy-uzeit.
    SELECTION-SCREEN: SKIP 2.
    PARAMETERS: p_diff type p.
    SELECTION-SCREEN: SKIP 2.
    PARAMETERS: p_dat3  TYPE sydatum,
                p_zei3  TYPE syuzeit.
    DATA: lv_timestamp_orig   TYPE timestamp,
          lv_timestamp_new    TYPE timestamp,
          lv_diff             TYPE p.
    AT SELECTION-SCREEN.
      PERFORM idoc_compare_dates USING p_dat1
                                       p_zei1
                                       p_dat2
                                       p_zei2
                              CHANGING p_diff.
      PERFORM idoc_calc_single_date USING p_diff
                                          p_dat1
                                          p_zei1
                                 CHANGING p_dat3
                                          p_zei3.
    *&      Form  IDOC_COMPARE_DATES
    FORM idoc_compare_dates  USING    iv_date_orig
                                      iv_time_orig
                                      iv_date_new
                                      iv_time_new
                             CHANGING cv_diff       TYPE p.
      DATA: lv_timestamp_orig    TYPE timestamp,
            lv_timestamp_new     TYPE timestamp.
      CONVERT DATE iv_date_orig TIME iv_time_orig
        INTO TIME STAMP lv_timestamp_orig TIME ZONE sy-zonlo.
      CONVERT DATE iv_date_new TIME iv_time_new
        INTO TIME STAMP lv_timestamp_new TIME ZONE sy-zonlo.
      cv_diff = lv_timestamp_new - lv_timestamp_orig.
    ENDFORM.                    " IDOC_COMPARE_DATES
    *&      Form  IDOC_CALC_SINGLE_DATE
    FORM idoc_calc_single_date  USING    iv_diff      TYPE p
                                         iv_date_orig
                                         iv_time_orig
                                CHANGING cv_date_new
                                         cv_time_new.
      DATA: lv_timestamp_orig   TYPE timestamp,
            lv_timestamp_new    TYPE timestamp.
      CONVERT DATE iv_date_orig TIME iv_time_orig
        INTO TIME STAMP lv_timestamp_orig TIME ZONE sy-zonlo.
      lv_timestamp_new = lv_timestamp_orig + iv_diff.
      CONVERT TIME STAMP lv_timestamp_new TIME ZONE sy-zonlo
        INTO DATE cv_date_new TIME cv_time_new.
    ENDFORM.                    " IDOC_CALC_SINGLE_DATE

  • Zen Vision:M problem, NEED HELP!

    My zen vision:m is starting to run slowly. It started right after my player froze and i reset it.Now its really slow and barely even switches screens sometimes.Right now its just a black screen with the keypad lit up.Whats wrong with it'sI NEED HELP!

    johnnnyp wrote:
    hi, i have a problem with my creative vision m. i wanted to watch a movie and it froze. i tried to shut it down but it wouldnt respond, and now is frozen. please help me if you can!
    You know its kinda rude to derail XBenzinoFla thread with your own problems, make your own thread next time.
    But to the both of you especially XBenzinoFla, try putting your ZVM in rescue mode and run scan disk to see if it hel
    ps.

  • Zen Micro problem need help

    Today i was listening to music and my zen micro just froze while playing and no buttons could be pressed and the lock button wasnt on. So i took the battery out and rebooted the player but it froze at the creative screen. I went home and i went to recovery mode and tried to reload the firmware but it said erasing firmware for more than 2 hours. So then i tried a format but it said formating for the same amount of time. I need help please. Also, recently i've had problems witht the headphone jack. When ever i would stick it in it would sound distorted and i would have to move it around until i got it to a certain spot to hear it good again. If anyone else has this problem please tell me. One more thing i had returned my other micro zen in for hard dri've probems and this was my new one do u think if i have to return in (hopefully not) that they would accept it.

    If the functions in Rescue Mode aren't working properly then you need to contact Creative Support.

  • Ipod problem NEED HELP ASAP

    Hello guys,my ipod touch has battery problems and internal speaker are not working and will apple replace me a new one,i even have 1 year warranty and i want a new ipod touch white instead of black<<<plz plz plz reply ASAP plz really need HELP!THANK YOU

    If you iPod is defective, in warranty and not abused Apple will replace it with a refurbished one.  They may or may not replace it with the white one.  You will have to ask.
    Other users have asked the same question but I hav never heard them come back with whether or not they go the color changed.

  • Another Infinite Login Loop Problem - need help badly

    Hello. I need help.
    When I start up my iMac (24 inch last generation model) I can't log into the OS. When I enter my password I see the default OS wallpaper (nothing else) then it kicks me to a blue screen then right back to the login. Same thing over and over. I've already ran disk utility off of the install CD to repair permissions, etc... but no luck. This even happens when I enter into safe mode. I'm running the latest version of the OS.
    Can anyone help me?

    Restore the bootable backup/clone or Time Machine backup. Without one, you have a difficult situation. First thing to try is boot with your install disc, run Disk Utility, and repair the disk.

  • Ipod nano Problems need help fast!!!!!!

    I got my nano in october everything was working fine.Until 2 weeks ago my ipod wasnt getting reconized by itunes.Im really getting frustrated and i need help.

    Welcome to Apple Discussions!
    Read through this...
    http://docs.info.apple.com/article.html?artnum=61711
    btabz

  • Urgent Problem, need help asap.

    Hello everyone,
    I'm sorry for the alarmist title, but I need help and I need it badly. Just last night, my macbook froze with nothing working. The mouse froze, the interrupt keys didn't work, nothing. I shut down the laptop, and tried to restart. I noticed a clicking sound coming from the lower left hand corner of the macbook. I'm assuming this is the hard drive.
    What happens is that there will be two clicks happening in a rythmic fashion, and after 15 second of booting up, a folder will appear with a question mark on the screen. The only thing I can do is power it down. Can someone please describe what is happening and make suggestions?
    The kicker is that I'm a college student studying in Denmark for the semester. The laptop is my only lifeline to back home. Please, any help is greatly appreciated.
    Matt

    You may have a disk failure or simply corrupted files. If you have a bootable backup that is working, then you can boot from it, erase your hard drive, then restore your backup. If not then do this:
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger and Leopard.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the installer. Now restart normally.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger, and 4.1 for Leopard) and/or TechTool Pro (4.6.1 for Leopard) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    If the drive is OK then you can reinstall OS X:
    How to Perform an Archive and Install
    An Archive and Install will NOT erase your hard drive, but you must have sufficient free space for a second OS X installation which could be from 3-9 GBs depending upon the version of OS X and selected installation options. The free space requirement is over and above normal free space requirements which should be at least 6-10 GBs. Read all the linked references carefully before proceeding.
    1. Be sure to use Disk Utility first to repair the disk before performing the Archive and Install.
    Repairing the Hard Drive and Permissions
    Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When the menu bar appears select Disk Utility from the Installer menu (Utilities menu for Tiger.) After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list. In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive. If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported, then quit DU and return to the installer.
    If DU reports errors it cannot fix, then you will need Disk Warrior (4.0 for Tiger) and/or TechTool Pro (4.5.2 for Tiger) to repair the drive. If you don't have either of them or if neither of them can fix the drive, then you will need to reformat the drive and reinstall OS X.
    2. Do not proceed with an Archive and Install if DU reports errors it cannot fix. In that case use Disk Warrior and/or TechTool Pro to repair the hard drive. If neither can repair the drive, then you will have to erase the drive and reinstall from scratch.
    3. Boot from your OS X Installer disc. After the installer loads select your language and click on the Continue button. When you reach the screen to select a destination drive click once on the destination drive then click on the Option button. Select the Archive and Install option. You have an option to preserve users and network preferences. Only select this option if you are sure you have no corrupted files in your user accounts. Otherwise leave this option unchecked. Click on the OK button and continue with the OS X Installation.
    4. Upon completion of the Archive and Install you will have a Previous System Folder in the root directory. You should retain the PSF until you are sure you do not need to manually transfer any items from the PSF to your newly installed system.
    5. After moving any items you want to keep from the PSF you should delete it. You can back it up if you prefer, but you must delete it from the hard drive.
    6. You can now download a Combo Updater directly from Apple's download site to update your new system to the desired version as well as install any security or other updates. You can also do this using Software Update.

  • Query not working for all the material, may be space problem, need help.

    Hai all,
      I have a query with  variable material and date range. we have 60,000 materials.
    I am doing the report for the month of feb, year 2007.
        When I am executing up to 30,000 material the report is generated, anything beyond 30,000 materials the query is abending with the following message.
    00010004 AFunction aborted 
    SR 044 TSV_TNEW_PAGE_ALLOC_FAILED     
    00010004 ASystem error in program SAPLRSDRC and form TSV_TNEW_PAGE_ALLOC_FAILED ,
    BRAIN 299SAPLRSDRC TSV_TNEW_PAGE_ALLOC_FAILED
    any help in this regard is very much appreciated.
      I am thinking it is a problem with space.But not sure what space it is called?! The basis team saw the temp db and found they have lot of space.
    Thanks, Vijay.

    This tells there is not enough main memory (not disk space) for the program to run.
    - You can look the dump in ST22, it will have suggestions on increasing the ROLLAREA??, you can forward that to Basis.
    - Most likely you will not have any more memory to assign so the above may not be feasible. Try to rework your query so it works with less data.

  • Problem with a query i need help ;(

    hi all guys!!! i have this query:
    SELECT SII_PLAACCIO.TITOL AS "PLA_TITLE" ,JBPM_PROCESSINSTANCE.ID_ AS "PROC_INST",SII_ACCIO_ORG_RESP.NOM AS "RESP_TITLE" ,SII_EIX.NOM AS "EIX_TITLE" ,
    REPTE.DESCRIPCIO AS "REPT_TITLE",SII_PROGRAMA.TITOL AS "PRG_TITLE" ,SII_ACCIO.TITOL AS "ACC_TITLE",PROJECTE.DESCRIPCIO AS "PROY_TITLE",ESTAT.DESCRIPCIO AS "ACC_STATUS", DEPARTAMENT.DESCRIPCIO AS "DEPARTAMENT",
    ROUND(SII_PRESSUPOST.TOTAL_EXECUTAT,'2') AS FON_SPENDED, ROUND(SII_PRESSUPOST.TOTAL_ASSIGNAT,'2') AS FON_BUDGET
    FROM SII_ACCIO
    ACTUACIO
    LEFT JOIN JBPM_PROCESSINSTANCE ON SII_ACCIO.PROCESS_INSTANCE_ID = JBPM_PROCESSINSTANCE.ID_
    LEFT JOIN JBPM_TOKEN ON JBPM_PROCESSINSTANCE.ROOTTOKEN_ = JBPM_TOKEN.ID_
    LEFT JOIN JBPM_NODE ON JBPM_TOKEN.NODE_ = JBPM_NODE.ID_
    INNER JOIN SII_MESTRE ESTAT ON (JBPM_NODE.NAME_ = ESTAT.VALOR AND ESTAT.TIPUS = 'EWF')
    LEFT JOIN SII_PRESSUPOST ON SII_ACCIO.PRESSUPOST = SII_PRESSUPOST.ID
    LEFT JOIN sii_accio_ORG_RESP ON SII_ACCIO.ID = SII_ACCIO_ORG_RESP.ACCIO_ID
    LEFT JOIN SII_MESTRE DEPARTAMENT ON (SII_ACCIO_ORG_RESP.DEPARTAMENT_ID = DEPARTAMENT.ID AND DEPARTAMENT.TIPUS = 'DEP')
    PROJECTE
    LEFT JOIN SII_MESTRE PROJECTE ON (SII_ACCIO.PROJECTE_ID = PROJECTE.ID AND PROJECTE.TIPUS = 'PRJ')
    PROGRAMA
    LEFT JOIN SII_PROGRAMA ON SII_ACCIO.PROGRAMA_ANUAL = SII_PROGRAMA.ID
    REPTE
    LEFT JOIN SII_MESTRE REPTE ON (SII_PROGRAMA.REPTE_ID = REPTE.ID AND REPTE.TIPUS = 'REP')
    EIX
    LEFT JOIN SII_EIX ON SII_PROGRAMA.EIX_ANUAL = SII_EIX.ID
    PLA ACTUACIO
    LEFT JOIN SII_PLAACCIO ON SII_EIX.PLA_ACCIO = SII_PLAACCIO.ID
    the problem is the following: the column "JBPM_PROCESSINSTANCE.ID_" can contain duplicate entries, but in the result i just want one of the rows... it doesn't matter which one, i just want only one...
    i can't use distinct and group by,.., i've been trying for the last 2 days almost but i cannot find a solution..

    But if don't want to use group by:
    select * from (
    SELECT SII_PLAACCIO.TITOL AS "PLA_TITLE" ,min(JBPM_PROCESSINSTANCE.ID_) AS "PROC_INST",SII_ACCIO_ORG_RESP.NOM AS "RESP_TITLE" ,SII_EIX.NOM AS "EIX_TITLE" ,
      REPTE.DESCRIPCIO AS "REPT_TITLE",SII_PROGRAMA.TITOL AS "PRG_TITLE" ,SII_ACCIO.TITOL AS "ACC_TITLE",PROJECTE.DESCRIPCIO AS "PROY_TITLE",ESTAT.DESCRIPCIO AS "ACC_STATUS", DEPARTAMENT.DESCRIPCIO AS "DEPARTAMENT",
    ROUND(SII_PRESSUPOST.TOTAL_EXECUTAT,'2') AS FON_SPENDED, ROUND(SII_PRESSUPOST.TOTAL_ASSIGNAT,'2') AS FON_BUDGET,
    row_number() over (partition by SII_PLAACCIO.TITOL ,SII_ACCIO_ORG_RESP.NOM ,SII_EIX.NOM ,
      REPTE.DESCRIPCIO,SII_PROGRAMA.TITOL ,SII_ACCIO.TITOL,PROJECTE.DESCRIPCIO,ESTAT.DESCRIPCIO, DEPARTAMENT.DESCRIPCIO,
    ROUND(SII_PRESSUPOST.TOTAL_EXECUTAT,'2'), ROUND(SII_PRESSUPOST.TOTAL_ASSIGNAT,'2') order by rownum) rn
       FROM SII_ACCIO
         --ACTUACIO--
         LEFT JOIN JBPM_PROCESSINSTANCE ON SII_ACCIO.PROCESS_INSTANCE_ID =  JBPM_PROCESSINSTANCE.ID_
         LEFT JOIN JBPM_TOKEN ON JBPM_PROCESSINSTANCE.ROOTTOKEN_ = JBPM_TOKEN.ID_
         LEFT JOIN JBPM_NODE ON JBPM_TOKEN.NODE_ = JBPM_NODE.ID_
         INNER JOIN SII_MESTRE ESTAT ON (JBPM_NODE.NAME_ = ESTAT.VALOR AND ESTAT.TIPUS = 'EWF')
         LEFT JOIN SII_PRESSUPOST ON SII_ACCIO.PRESSUPOST = SII_PRESSUPOST.ID
         LEFT JOIN sii_accio_ORG_RESP ON SII_ACCIO.ID = SII_ACCIO_ORG_RESP.ACCIO_ID
         LEFT JOIN SII_MESTRE DEPARTAMENT ON (SII_ACCIO_ORG_RESP.DEPARTAMENT_ID = DEPARTAMENT.ID AND DEPARTAMENT.TIPUS = 'DEP')
         --PROJECTE--
         LEFT JOIN SII_MESTRE PROJECTE ON (SII_ACCIO.PROJECTE_ID = PROJECTE.ID AND PROJECTE.TIPUS = 'PRJ')
         --PROGRAMA--
         LEFT JOIN SII_PROGRAMA ON SII_ACCIO.PROGRAMA_ANUAL = SII_PROGRAMA.ID
         --REPTE--
         LEFT JOIN SII_MESTRE REPTE ON (SII_PROGRAMA.REPTE_ID = REPTE.ID AND REPTE.TIPUS = 'REP')
         --EIX--
         LEFT JOIN SII_EIX ON SII_PROGRAMA.EIX_ANUAL = SII_EIX.ID
         --PLA ACTUACIO--
         LEFT JOIN SII_PLAACCIO ON SII_EIX.PLA_ACCIO = SII_PLAACCIO.ID
    ) where rn=1Max
    http://oracleitalia.wordpress.com

  • Interesting date query I need some help with

    I need to select dates for each day starting from a
    particular date up until the present day. These dates are for days
    where a value doesn't exist in the table.
    Thanks for any advice

    > how to do this purely in sql
    In ms sql you could use a table valued udf. The udf could
    generate the dates and insert them into a table variable that would
    be used in your join. The basic logic is the same. Create two
    variables: @startDate and @todaysDate. Then loop while the start
    date is <= today's date. Within each loop insert the current
    date into the table variable, and increment the start date
    http://msdn.microsoft.com/en-us/library/ms191165.aspx
    while @startDate <= @today
    begin
    insert into @dateTable (theDate) values (@startDate)
    set @startDate = dateAdd(d, 1, @startDate)
    end
    Though personally I prefer using using a permanent calendar
    table. I use that table in my selects rather than generating a
    table of dates each time.

Maybe you are looking for

  • Error-"File failed to be converted using Adobe ExportPDFonline"........???

    Just purchased a license and all was going swimmingly when all of a sudden this happened. I've managed to convert 4 out of 5 pdf's to docx.  The error message pops up with no suggestion as to what went wrong so all I can do is click ok and stare blan

  • IPhone 6 (with iOS 8.0.2 Bluetooth Issue (with BlueAnt PUMP HD Sportbuds)

    Well, I've got an iPhone 6 with iOS 8.0.2 and I can't pair my BlueAnt Pump HD buds to the phone.... Bluetooth is turned on on both devices but the iPhone doesn't seem to recognize my earbuds, it keeps searching, any help would be appreciated, thanks.

  • Profit Center Local Currency (Currency Type 90)

    We are in the middle of implementation of SAP and our curreny setting is as the following: Group Currency: USD Controlling Area Currency: Currency Type 30 (USD) FYI we are also implementing multiple valuation as the following (T-Code 8KEM): Currency

  • PhotoCenterPlugin does not load in Safari

    I installed the PhotoCenterPlugin which is used by a number of sites including Snapfish, Costco, and Walmart. However, whenever I attempt to open the photo upload page on these sites, Safari fails to load the plugin. I have tried reinstalling the plu

  • ICal calendars vanished

    I am using iCal on 10.4.11 Recently after deleting what I believed to be a corrupted plist file none of my calendars appear. Now here is the strange part. When I choose to make a new Calendar Group my old events and times come back but none of the ca