|
SQLDEV_13
Starting Member
1 Post |
Posted - 2008-12-10 : 15:13:15
|
| I want to Exclude the two columns from the Group By clause of the following query, If I don't include them its giving me error that "Column 'T4.ORG_NAME' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause."All I want to put City and State information in front of Project. It should not impact the aggregate function.Please help me its really urgent!Thanks in Advance for your time and help,Shubhra------------------------select {fn CONCAT({fn CONCAT(T1."PROJ_ID",' ')},T2."PROJ_NAME")} "Project" ,T4."org_name" "City",T5."org_name" "State", {fn CONCAT({fn CONCAT(T1."BILL_LAB_CAT_CD",' ')},T3."BILL_LAB_CAT_DESC")} "Project Labor Cat" ,sum(case when T1."PD_NO" = 10 then T1."ACT_HRS" else 0 end ) "Current PeriodBillable Hours" , sum(case when T1."PD_NO" = 10 then T1."REV_RT_AMT" * T1."ACT_HRS" else 0 end ) "Current PeriodBillable Dollars" ,sum(T1."ACT_HRS") "YTDBillable Hours" , sum(T1."REV_RT_AMT" * T1."ACT_HRS") "YTDBillable Date" ,T2."CUST_ID" "Customer" ,T1."PROJ_ID" "Project"from "DELTEK"."PROJ" T2,"DELTEK"."LAB_HS" T1,"DELTEK"."BILL_LAB_CAT" T3,"DELTEK"."ORG" T4,"DELTEK"."ORG" T5where T2."PROJ_ID" = T1."PROJ_ID" and T1."BILL_LAB_CAT_CD" = T3."BILL_LAB_CAT_CD"and SUBSTRING(T1.PROJ_ID,22,3)=SUBSTRING(T4.org_ID,9,3)and SUBSTRING(T1.PROJ_ID,19,2)=SUBSTRING(T5.org_ID,6,2)and T2."BILL_PROJ_FL" = 'Y' and T1."FY_CD" = '2008' and T4.lvl_no = 4and T5.lvl_no = 3and T1."PROJ_ID" like '%1004.1%'group by {fn CONCAT({fn CONCAT(T1."PROJ_ID",' ')},T2."PROJ_NAME")},T4."org_name",T5."org_name" ,{fn CONCAT({fn CONCAT(T1."BILL_LAB_CAT_CD",' ')},T3."BILL_LAB_CAT_DESC")},T2."CUST_ID", T1."PROJ_ID"order by 1 asc , 2 asc , 7 asc , 8 asc |
|