'; UPDATE countries SET great = true WHERE name = 'America'; --

More based: '; UPDATE countries SET great = true; --

(this is not an endorsement of donald trump)

  • AngryishHumanoid@reddthat.com
    link
    fedilink
    arrow-up
    21
    ·
    4 days ago

    No country dim table I’ve ever seen would just have “America” as the country name, but now I’m just being a pedantic asshole, which is my default setting.

      • AngryishHumanoid@reddthat.com
        link
        fedilink
        arrow-up
        5
        ·
        4 days ago

        We could do name LIKE ‘%AMERICA%’ but that would grab a few extra countries. Course that faction of the political spectrum would be all in favor of “acquiring” more countries anyway.

        • xmunk@sh.itjust.works
          link
          fedilink
          arrow-up
          5
          ·
          4 days ago

          Ahem pushes glasses up nose arch, umm ackshually you would need to use ILIKE if you’re feeding in America in all caps unless you have a custom caseless collation set on that column.

          • AngryishHumanoid@reddthat.com
            link
            fedilink
            arrow-up
            4
            ·
            4 days ago

            I haven’t used a database that required me to specify case in 15 years, and I’ll be cold dead in the grave before I do it again… only because I assume that’s what they use IN HELL.

            • xmunk@sh.itjust.works
              link
              fedilink
              arrow-up
              4
              ·
              4 days ago

              All string comparisons are case insensitive by default? Is that an Oracle thing?

              Postgres absolutely supports case based string diffentiation in data (by default all DB identifiers are case insensitive though which I absolutely appreciate).

              • nogooduser@lemmy.world
                link
                fedilink
                English
                arrow-up
                2
                ·
                3 days ago

                Microsoft SQL Server is most commonly set up as case insensitive in my (limited) experience (it does support case sensitivity too).

  • xmunk@sh.itjust.works
    link
    fedilink
    arrow-up
    10
    ·
    edit-2
    4 days ago

    Alternative:

    UPDATE country
    SET great = true
    WHERE name = 'America';update money set owner=account.id from account where account.name='Donald Trump';'
    

    And that’s why we use bound parameters.

    (Also, if it’s unclear I also don’t support Donald Trump)

  • m-p{3}@lemmy.ca
    link
    fedilink
    arrow-up
    4
    arrow-down
    1
    ·
    edit-2
    4 days ago

    Gigachad

    '; UPDATE countries SET shithole = true WHERE name = '%United States%'; --