例如:
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 ;
在上面的示例中,我想删除从 FOR COLUMN 所在行开始的整个单词。
答案1
怎么样:
cat myscript | sed 's/FOR COLUMN.*$//g' > myscript.filtered
myscript
上面显示的文件名是什么时候?这是您希望实现的目标吗?