Hey, Hi !

I'm Rakesh, and I'm passionate about building businesses that thrive, not just survive. I invite you to join the conversation. Whether you're a seasoned professional, a budding entrepreneur, or simply curious about the world of building things, this blog is for you. It's a space to learn, grow, and share your experiences on the journey from ideas to impact.

Extracting Month from a Date. Oracle SQL.

I have an employee table and need to find the total hiring done for each month & display result in ascending order of months.


Points to focus:
- extract month.
- convert character formatted date to date type.
- group by extracted month.
- apply count.

select
extract (month from (to_date(hire_date,'mm dd yyyy'))) as "Month",
count(*) as "Total Hiring"
from employees
group by extract (month from (to_date(hire_date,'mm dd yyyy')))
order by "Month";

PIS: what if I want to see employees hired within the first half of any month?
Please be in touch with me for the solution.



Comments