Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Return 1 row from joined table
I'm having a problem with this SQL string, I want 1 record from each
joined salestrans table like for instance:
SALESNUMBE ITEMNUMBER
---------- --------------------
738744 6398000
738734 1201270
738737 2216000
738644 5251000
738694 5943000
737714 2401000
736774 5943000
But the following SQL string:
SELECT str.salesnumber, str.itemnumber FROM XAL_SUPERVISOR.SALESTRANS STR, XAL_SUPERVISOR.SALESTABLE ST WHERE str.dataset = 'FIK' AND st.dataset = 'FIK' AND st.salesnumber = str.salesnumber AND st.DELIVERYDATE = TO_DATE('23-12-2004', 'DD/MM/YYYY') AND st.FIKRetbon = 1 AND ROWNUM = 1 Returns only:
SALESNUMBE ITEMNUMBER
---------- --------------------
738744 6398000
Can someone please tell me how I solve this?
Thanks in advance,
Mike Received on Thu Dec 23 2004 - 03:03:21 CST