Category: Blog

  • A New Word: La Guadière

    la guadière – n. a glint of goodness you notice in something that you wouldn’t expect, which is often only detectable by sloshing them back and forth in your mind until everything dark and gray and common falls away, leaving something shining at the bottom of the pan – a rare element hidden deep in the bedrock, that must’ve washed there by a storm somewhere upstream.

    It is easy at first glance when something sad, distasteful, or otherwise negative occurs to get upset or see a problem. When you think about it, sometimes you feel like there is something good. That blessing-in-disguise that is revealed after your initial reaction fades and you have a moment to consider the situation.

    I have often felt that I react to something and think about the negative. That seems like a very human reaction. For example, a customer doesn’t want to spend time changing a process, even though it’s broken. I only think about the negative.

    However, if you pause a moment and twist the situation from your view to someone else’s, then la guadiere comes out. A broken process, but a known one, isn’t the worst thing in the short term. It allows other work to get done, people are familiar, and it can be lower stress, even if it requires more effort.

    The same thing if you have an issue. A flat tire, broken internet, a broken horse feeder. There’s some la guadiere in there. A flat might let me know my tires need replacing and they’re dangerous, or maybe I haven’t cleaned up around the garage properly. Internet teaches me to prepare more in advance (or take a break). Broken horse feeders let me catch up on some maintenance and maybe improve something before it gets much worse.

    Find the good in life, even when it’s bad.

    From the Dictionary of Obscure Sorrows

  • UNION vs UNIONALL: #SQLNewBlogger

    While writing another post I realized my UNION query didn’t work as one might initiall expect, so I decided a short post was worth writing. This is based on a previous post on QUOTENME().

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    Missing a Row

    When I ran this code, I got only a single row. There’s a UNION here, so why? One would expect two rows from these queries.

    2026-05_0287

    Let’s change to UNION ALL. Now we see this:

    2026-05_0288

    You can likely spot the reason, but it’s because both rows in the result are the same. In this cse, UNION is designed to remove duplicates. In the docs, it explicitly says

    • UNION ALL – Includes duplicates
    • UNION Excludes duplicates

    We can see this in this examples I’ve got this code that gives me two virtual tables of numbers, some of which are duplicate:

    WITH myTally(n)
    AS
    (SELECT n 
     FROM (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10)) a(n)
    )
    , myTally2(n)
    AS
    (SELECT n 
     FROM (VALUES (1), (20), (3), (40), (5), (60), (7), (08), (9), (100)) b(n)
    )
    SELECT n
    FROM myTally
    UNION 
    SELECT n
     FROM myTally2

    When I run the query, with UNION, I see these results, 14 rows:

    2026-05_0289

    If I change to UNION ALL, 20 results.

    2026-05_0290

    Use UNION when you want unique things. UNION ALL if you need to see ALL The Rows.

    SQL New Blogger

    This post was about 8 minutes spent after I finished the other post. It is a quick expansion on something I saw in another post, it has a separate focus, and it shows I’ve realized something and built on previous work.

    You can showcase these skills.

  • Join Me in San Diego to Learn about AI and Software Development

    You might have seen this graphic on the side of my blog. It’s my discount code for VS Live in San Diego this September.

    I got accepted to talk about LLMs on your local machine or data center, which is something I think will be more and more important in the future. Already the EU is less thrilled with US tech giants, and I suspect many other companies will rethink allowing their data to flow to non self-hosted LLMs.

    I’m also talking about the Data API Builder, which makes software development much easier for software engineers, and includes an MCP server. I’m excited to showcase how this has grown over the last few years and think it’s a cool technology.

    Register today, use my code, save your company some money, and join me in Sunny San Diego. The Padres aren’t in town, but we can still enjoy some time in San Diego.

  • Vacation Week

    It might seem I’ve been gone a lot, and I have been. April had me taking three trips, and May wasn’t better with 3 before this, but those were for work. This week the family and I are on a cruise to Alaska, spending a week traveling with the kids.

    I know it will be amazing, but no blogs this week while I take some time to recharge.