Re: Calendar Table

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Anthony Apollis <anthony(dot)apollis(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Calendar Table
Date: 2024-07-10 15:48:34
Message-ID: CAKFQuwbf7g4iJ6ytqosXKuQzG7g3JCfU9yQLhGHAPssdK1NTwQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, Jul 10, 2024 at 8:38 AM Anthony Apollis <anthony(dot)apollis(at)gmail(dot)com>
wrote:

> -- Query to get the year and number of days
>
> SELECT
> EXTRACT(YEAR FROM "Date") AS "Year",
> COUNT(*) AS "NumberOfDays"
> FROM "Prod"."IMETA_Calendar"
> GROUP BY EXTRACT(YEAR FROM "Date")
> ORDER BY EXTRACT(YEAR FROM "Date");
>

Seems odd to be using extract year from date when you have an FY column.

> I get some output: [image: f6]
>

Nothing you've shown produces that output. I would suggest you simplify
and make self-contained a script-based test case, ideally using psql, that
you can run and share, asking questions regarding the main piece here which
is creating a table, populating it with data, and querying it. Once you
get that part solid you can figure out how to incorporate your spreadsheets
- which is mostly outside the realm of on-topic help for a
PostgreSQL mailing list.

David J.

>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2024-07-10 16:05:15 Detecting PostgreSQL client library
Previous Message Anthony Apollis 2024-07-10 15:38:12 Calendar Table