sql - Query Error, cant display correctly -
There is an error in my query, I try to display the date, the data name (which is POS and non-POS) And the number of data
desired output:
02/20/2014, POS, 40 02/20/2014, non-POS, 15 < / Pre> question:
select TO_CHAR (D.dtime_day, 'mm / dd / yyyy') to join in owner_dwh.dc_date d (select count (case Left when upper (t.ticket_customer_user_id) = upper ('POS normal') then 1 and zero end) --POS || ',' || calculation ( The case is when the upper (t.ticket_customer_user_id) = upper ('hcphuser' then 1 and zero end) from the app_account - user.strrs_ticket T WHERE Trunc (t.create_time, 'DAY') between SYSDATE - 119 and SYSDATE - Trunc Left d.dtime_day = t.create_time at 1 group (t.create_time, 'DAY')) (selection number (case when upper (t.ticket_customer_user_id) = upper ('position') then 1 and zero end) - POS || ',' || Calculation (case when upper (t.ticket_customer_user_id) = upper ('user') then 1 and NULL END) - User by app_account.tars_ticket T WHERE Trunc (T.Code_Tit, 'DAY') Between- SYSDATE - 119 and SYSDATE - Tr 1 group by unc (t.code. Time, 'DAY')) d.dtime_day = t at close_time WHERE t.queue_id (63, 61, 69, 59, 58, 60, 56, 64, 65, 23, 67, 68, 57); My error:
ORA-00904: "T". "CREATE_TIME": Invalid identifier 00 9 04. 00000 - "% s: invalid identifier" Data is DTIME_DAY (OWNER_DWH.DC_DATE) like this:
02/12/2014 02/13/2014 02/14/2014 While in app_count.otts.ticket
create_time and close_time open and close ticket The date is TORET_CUSTOMER_USER_ID in POS-generic and user (like its category)
Please help me and fix my query. Thank you in advance.
You will need to repeat the nickname outside the parentheses:
SELECT To_char ( D.dtime_day, 'MM / dd / yyyy') FROM (owner_dwh.dc_date d is omitted (selection number (case when upper (t.ticket_customer_user_id) = upper ('POS-generic') then 1 and zero end) - -POS || ',' || Calculation (case when upper (t.ticket_customer_user_id) = upper ('hcphuser' then 1 and zero end), - user t.create_time - !!! Of course, this field Do not think about returning! Ap_account.Totrics_ticketT WHERE Trunc (t.create_time, 'DAY') Between, SYSDATE - 119 and SYSDATE-1 and t.queue_id IN (63, 61), 69, 59, 58, 60, 56, 64, 65, 23, 67, 68, 57) Group by trunk (T. Crete_TyT , 'Day')) TD timeted = T. kreate_time) left count (select calculation (case when upper (t.ticket_customer_user_id) = upper ('condition') then 1 and zero end) --POS || ', 'Count (case when upper (t.ticket_customer_user_id) = upper (' user ') then 1 to the end of the cancellation faucet), --USER T.close_time - Return from subcategory !!!! From APP_account.otrs_ticket T TRUNC (t.close_time, 'days') between SYSDATE - 119 and SYSDATE - 1 and not in t.queue_id (63, 61, 69, 59, 58, 60, 56, 64, 65, 23, 67, 68, 57) Group by trunc (T.close_youm, 'de')) D on U. Dreamtime_de = U.Close_time - you can not use T twice to join !!! All this can be collected by your query ...
Comments
Post a Comment