News for hackers. Stuff that matters.
Re:SQL: One of the most valuable skills by teej on Wednesday February 13, 2019 @12:03AM (#19150572)
For those trying to up their SQL game from basic selects and grouping, I suggest learning:

- Common Table Expressions (CTEs). They will equip you to write clean, organized, and expressive SQL.

- CREATE TABLE AS SELECT. This command powers SQL-driven data transformation.

- Window functions, particularly SUM, LEAD, LAG, and ROW_NUMBER. These enable complex calculations without messy self-joins.

Learning those three will change your relationship with SQL and blow the door open of problems you can solve with the language.

Re:SQL: One of the most valuable skills by nimajalali on Wednesday February 13, 2019 @12:32AM (#19150701)
I’d add LATERAL JOINs to the list.

For those unaware of LATERAL JOINs, it’s like a for each loop in SQL. Blew my mind and opened up so many possibilities.

Re:SQL: One of the most valuable skills by chucky_z on Wednesday February 13, 2019 @12:10AM (#19150606)
ROW_NUMBER is absolutely the best, especially for marketing related customer data.