Date and Time calculations using INTERVAL – with examples in PostgreSQL.

Saying time is important is to state the obvious. Our lives are built on time. We only have so much of it and once it is gone, there is no getting it back. While not as important as that time, date and time data values are integral pieces in most –if not all– database infrastructure and design. At some point or another, date and time values must be considered. PostgreSQL has many functions and options for date and time value manipulation. In this post, I look at the INTERVAL type for date and time calculations….

[Head this way for great PostgresSQL blogging >>>]
Advertisements

The EXTRACT() function with examples in PostgreSQL

At times, you may only need a certain portion of a date interval or TIMESTAMP. Luckily in PostgreSQL, we have the EXTRACT() function that allows you to grab just those particular bits of data. See how with a few simple examples in this post…

[Head this way for great PostgresSQL blogging >>>]

FIRST_VALUE() Window Function – with example in PostgreSQL.

With Window Functions, there is always something to learn. They have numerous moving parts but allow for powerful queries that return powerful results. I recently learned of (new to me, but not new to the SQL world) another interesting Window Function, FIRST_VALUE(). Read on as I explore more about it…

[Head this way for great PostgresSQL blogging >>>]

Searched CASE expression in PostgreSQL – with examples.

In this blog post, we will look at one type of ‘conditional formatting’ that enables you to perform complex calculations. PostgreSQL (and SQL in general) provides us with a couple of variants of the CASE statement which could be used for this very thing, among many many others. Learn with me as I make my way through writing this post…

[Head this way for great PostgresSQL blogging >>>]

Handy string functions: right() and left() with examples in PostgreSQL

In this blog post, I will visit a couple of handy string functions for extracting a specified number of characters from a string of text. Yet, with both functions, you can start from a certain position. Either left (beginning) or right (the end). Let’s see them in action with some examples…

[Head this way for great PostgresSQL blogging >>>]