plsql - Group by function column -


i'm writing query this...

select to_char(e_date, 'mon/yyyy') month , location_code, count(employee_number) from...

now want group month , location_code. how use to_char(e_date, 'mon/yyyy') month in group clause?

edit:

select to_char(vheda.e_date, 'mon/yyyy') months , hla.location_code, count(vheda.employee_number) emp_count  virtu.virt_hr_emp_daily_attendance vheda  inner join per_all_people_f papf on vheda.party_id = papf.party_id inner join per_all_assignments_f paaf on papf.person_id = paaf.person_id  inner join hr_locations_all hla on paaf.location_id = hla.location_id  (trunc(sysdate) between papf.effective_start_date , papf.effective_end_date)  --and (vheda.e_in_time not null) , vheda.e_duration <> 0 , (trunc(sysdate) between paaf.effective_start_date , paaf.effective_end_date)  , vheda.e_date between '1-aug-2014' , '31-oct-2014' group hla.location_code, vheda.e_date order vheda.e_date 

out put when use group clause group to_char(vheda.e_date, 'mon/yyyy'), hla.location_code:

ora-00979: not group expression 00979. 00000 - "not group expression" *cause:
*action: error @ line: 58 column: 37

select to_char(e_date, 'mon/yyyy') month , location_code, count(employee_number)  ... group to_char(e_date, 'mon/yyyy'), location_code 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -