0

eg:

CREATE VIEW AIPKEYITEM.SEASONGROUPNETSALES ( 
CALENDARID , 
PRODUCTGROUPID FOR COLUMN PRDGRPID   , 
NETSALESDOLLARS FOR COLUMN NETSA00001 , 
NETSALESUNITS FOR COLUMN NETSA00002 ) 
AS 
SELECT  
        (SELECT MIN(CALENDARID)  
            FROM AIPKEYITEM.KEYIT00002  
            WHERE FISCALYEAR = CAL.FISCALYEAR  
            AND FISCALSEASON = CAL.FISCALSEASON) CALENDARID  
    , PRODUCTGROUPID  
    , SUM(NETSALESDOLLARS) NETSALESDOLLARS  
    , SUM(NETSALESUNITS) NETSALESUNITS  
    FROM AIPKEYITEM.KEYIT00002 CAL  
    INNER JOIN AIPKEYITEM.WEEKG00001 WEEKGROUPORGUNITUNITSDOLLARS  
    ON CAL.CALENDARID = WEEKGROUPORGUNITUNITSDOLLARS.CALENDARID  
    GROUP BY CAL.FISCALYEAR, CAL.FISCALSEASON, PRODUCTGROUPID ; 

In the above example I want to remove entire word starting from FOR COLUMN in which line it is present.

1
  • 2
    welcomme to U&L, please edit you post with: what is the expected result ? what have you tried so far ? – Archemar Sep 7 '15 at 14:55
0

How about:

cat myscript | sed 's/FOR COLUMN.*$//g' > myscript.filtered

when myscript is the name of the file which is shown above? Is that what you wish to achieve?

1
  • Great. Since it is working please mark my answer as such, thanks. – Ned64 Sep 7 '15 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.