RE: SQL struggle - UPDATE too?

2003-02-26 Thread Saira Somani
Quote from one of the listers: >With free advice, you get what you paid for it. >If you bite the hand that feeds you, >you may just go hungry the next time you ask for a handout. >NOBODY owes you an answer; >regardless of how dire a situation you find yourself. >HAND! I will end this message t

RE: SQL struggle - UPDATE too?

2003-02-26 Thread Gorden-Ozgul, Patricia E
Always take what you need and leave the rest. ...and don't take any list comments personally. -Original Message- Sent: Wednesday, February 26, 2003 11:29 AM To: Multiple recipients of list ORACLE-L This worked: SELECT A.WHSE_CODE,A.ITEM_NUM,B.LAST_COST FROM ITEM_W A,(SELECT DISTINCT (LA

RE: SQL struggle - UPDATE too?

2003-02-26 Thread Saira Somani
This worked: SELECT A.WHSE_CODE,A.ITEM_NUM,B.LAST_COST FROM ITEM_W A,(SELECT DISTINCT (LAST_COST),SUBSTR(ITEM_NUM,1,6) ITEM_NUM FROM ITEM_W WHERE LAST_COST<>0) B WHERE SUBSTR(A.ITEM_NUM,1,6) = B.ITEM_NUM AND RTRIM(A.WHSE_CODE) NOT LIKE ('CD%'); A suggestion from someone on the COGNOS mailing lis

RE: SQL struggle - UPDATE too?

2003-02-26 Thread Saira Somani
Thanks. But neither statements work. hl1_cost is never populated for any of the -OR items. whse_code and item_num are the primary keys. Thanks again for your help. Saira -Original Message- Sent: February 26, 2003 12:29 AM To: Multiple recipients of list ORACLE-L Do these SQL statement

RE: SQL struggle - UPDATE too?

2003-02-26 Thread Odland, Brad
CHeck your yahoo mail I sent you some psuedo code you can flesh out. BRad -Original Message- Sent: Wednesday, February 26, 2003 6:34 AM To: Multiple recipients of list ORACLE-L I'd prefer a procedure as it is likely that this will have to be run every week. FYI: I'm not looking for

RE: SQL struggle - UPDATE too?

2003-02-26 Thread Saira Somani
I'd prefer a procedure as it is likely that this will have to be run every week. FYI: I'm not looking for you to write the code for me, just give me some general direction as I am new to PL/SQL and now I've been asked by management to script this. This is what happens when your IT department is c

Re: SQL struggle - UPDATE too?

2003-02-25 Thread Chip
Do these SQL statements work ? SELECT whse_code , item_num , last_cost , ( SELECT last_cost FROM item_whl1 WHERE whse_code = 'HL1' ANDREPLACE(u.item_num,'-OR') = hl1.item_num ) hl1_cost FROM item_wu / UPDATE ( SELECT whse_code , it

RE: SQL struggle - UPDATE too?

2003-02-25 Thread netmadcap
Saira : how do u want to achive this ? using procedure or a single update stmt ? -Original Message- Somani Sent: Tuesday, February 25, 2003 3:27 PM To: Multiple recipients of list ORACLE-L I am very confused (and fairly new to SQL which would be my excuse to post such amateurish question

RE: SQL struggle - UPDATE too?

2003-02-25 Thread Saira Somani
I am very confused (and fairly new to SQL which would be my excuse to post such amateurish questions on this list). Now I've been asked to update LAST_COST on item_w so it looks like this: WHSE_CODEITEM_NUM LAST_COST -- --

RE: SQL struggle

2003-02-25 Thread Saira Somani
Title: RE: SQL struggle Thank you for your assistance – it works -  and I have one more question:   How can I also get the SELECT to show me the original item number – i.e with the ‘-OR’?   Thanks, Saira   -Original Message- From: Jacques Kilchoer [mailto:[EMAIL PROTECTED

RE: SQL struggle

2003-02-25 Thread Jacques Kilchoer
Title: RE: SQL struggle (see answer below) > -Original Message- > From: Saira Somani [mailto:[EMAIL PROTECTED]] > > Oracle 8.1.7 on AIX 4.3 > > Here is what my data looks like in a table called item_w: > > WHSE_CODE    ITEM_NUM

SQL struggle

2003-02-25 Thread Saira Somani
List Gurus, I need help and I won't be ashamed to ask :) Oracle 8.1.7 on AIX 4.3 Here is what my data looks like in a table called item_w: WHSE_CODEITEM_NUM LAST_COST -- -- HL1 111230