Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8238383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:47:42+00:00 2026-06-07T19:47:42+00:00

I am using Oracle SQL Developer. I essentially have a table of pictures that

  • 0

I am using Oracle SQL Developer.
I essentially have a table of pictures that holds the columns:

[DATE_CREATED(date), NUM_of_PICTURES(int)]

and if I do a select *, I would get an output similar to:

01-May-12    12
02-May-12    15
03-May-12    09
...
...
01-Jun-12    20
...
etc.

I am trying to aggregate these sums of pictures into MONTHLY numbers instead of DAILY.

I’ve tried doing something like:

select Month(DATE_CREATED), sum(Num_of_Pictures))
from pictures_table
group by Month(DATE_CREATED);

This outputs an error:

ORA-00904: "MONTH": invalid identifier
00904. 00000 -  "%s: invalid identifier"
*Cause:    
*Action:
Error at Line: 5 Column: 9

Do I have the Month function wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T19:47:45+00:00Added an answer on June 7, 2026 at 7:47 pm

    I would be inclined to include the year in the output. One way:

    select to_char(DATE_CREATED, 'YYYY-MM'), sum(Num_of_Pictures)
    from pictures_table
    group by to_char(DATE_CREATED, 'YYYY-MM')
    order by 1
    

    Another way (more standard SQL):

    select extract(year from date_created) as yr, extract(month from date_created) as mon,
           sum(Num_of_Pictures)
    from pictures_table
    group by extract(year from date_created), extract(month from date_created)
    order by yr, mon;
    

    Remember the order by, since you presumably want these in order, and there is no guarantee about the order that rows are returned in after a group by.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm writing code using Oracle SQL Developer. I have a simple select statement that
I am using Oracle Sql Developer I have a huge script that creates tables,
I'm using oracle 11g sql developer I have a varchar2 column with dates as
I am using Oracle SQL Developer and trying to export a table to a
I'm new to using Oracle SQL Developer and to using an Oracle DB (have
Using Oracle SQL Developer I'm trying to access a given package that has been
I'm using Allround Automation PL/SQL Developer with Oracle 10g, and today I've noticed that
I am using Oracle SQL developer to create a basic table with the following
In Oracle SQL Developer, one can list the data in a table using the
I am using Oracle 10 g and PL/SQL Developer for the development. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.