sql - Operate on pseudocolumn in oracle -
I am creating two pseudocolumns that I want to work on (taking percentage difference in them), which is usually done Although with two numerical areas I am getting an error;
ORA-00904: "pseudocolumn_B": invalid identifier
My code:
select DW.mykey, sum (Case when TODATE between 'ms.day_date' ('10 / 09/2014 ',' DD / MM / YYYY ') and TO_DATE ('07 / 10/2014', 'DD / MM / YYYY') then MSN Brace & End End) Pudocalcal_A, Amount (case when TODATE between ms.day_date ('03 / 08/2014 ',' DD / MM / YYYY ') and TO_DATE (' 09/09/2014 ',' DD / MM / YYYY ') then ms.numbers second 0 end) change_in_pseudo_columns as pseudocolumn_B (pseudocolumn_A - pseudocolumn_B) / pseudocolumn_B - this line is h He fails Table DW to Table 2 M.S. But ms.mykey = DW.mykey WHERE dw.some_field = 'some_value' by group DW.mykey by order DW.mykey
I believe that I am capable of doing non-Oracle databases Do this first with and like this is some difference for Oracle, but I can be wrong. How can I work on pseudonyms as the above mentioned effort?
You can not use the nickname column in the same
SELECT statement more
WHERE section
You can use a whistle and get the required aggregation column and then you can calculate it as below
< With code> whistle (select DW.mykey, sum (case when TODATE between 'ms.day_date' ('10 / 09/2014 ',' DD / MM / YYYY ') and TO_DATE ('07) , Psuedocolumn_A, amount (case when ms.day_date between TO_DATE ('03 / 08/2014 ',' DD / MM / Y YYY ') and TO_DATE (' 09/09/2014 ',' DD / MM / YYYY ') then ms.numbers else 0 end) from psuedocolumn_B to table_1 DW ms.mykey = table_ms on dw.mykey Join WHERE dw.some_field = select DW.mykey by 'some_value' group *, (psuedocolumn_A - psuedocolumn_B) / psuedocolumn_B cte.mykey from cte order
Comments
Post a Comment