[GRLUG] [DISCUSS] Wed="Select" not "Loops" in Postgress...an SQL Rant (fwd)

Grand Rapids Linux Users Group grlug at grlug.org
Tue May 9 09:35:37 EDT 2023


"Select" not "Loops" in Postgress...an SQL
MAIN Topic: Making effective use of select in Postgress... an SQL Rant.
 (or, poetically, "Dof they for loops"):  Presenter: Stephen Lembark
<https://www.google.com/url?q=https://www.sluug.org/bio/Stephen_Lembark&sa=D&source=calendar&usd=2&usg=AOvVaw3Fh2QKIvGtTo3gUTn_4Ys1>
Preliminary narrative
<https://www.google.com/url?q=https://www.sluug.org/resources/presentations/media/2023/MAIN/2023-05-10_SLUUG_preliminary.txt&sa=D&source=calendar&usd=2&usg=AOvVaw1p-ZRGJH1D0fMKw7uZVIJ4>

Face it: Most of what we all write for queries isn't poetry, let alone True
Art. All too often we hack a 'select * from foobar' and figure that "the
code can handle it" or some such.

Blech.

This month let's look at how to use simple data structures and SQL to
generate straightforward tables for time-based analysis with SQL -- nary a
loop or block required!

This talk uses and shows how to create the basis of a complete data
analysis framework using SQL, sequences, and range data types. It's
efficient in time and space, flexible for handling calendar and fiscal
periods, and it'll impress your friends in bar bets.

Or, to state this a bit more poetically...

    Doff thy for loops and
    take joy in select!

    Thus is the way we
    shall make use of SQL*:
    generate what is
    needed with nary
    a loop!

           KISS what is
    real, and so make it
    your own! Sets are your
    friends, no loops needed!

    With Apologies
    to The Bard (of course).

    * "squeal", as in the noise
    of a pig.



More information about the grlug mailing list