boatswain

joined 2 years ago
[–] boatswain 1 points 4 months ago (1 children)

I really didn't think that's correct--though it's been a few years since I did SQL regularly.

SELECT *
FROM articles
WHERE last_updated >= %s
  AND created_at IS NOT NULL
UNION
SELECT *
FROM articles
WHERE id IN (1, 2, 3)
  AND created_at IS NOT NULL

That should give a list of all articles updated after whatever date (regardless of ID), appended to a list of all articles where the ID is 1, 2, or 3 (regardless of when they were last updated). I would expect to see extra articles that only fit one criteria or the other, and also duplicate articles.

I included the join quote because an inner join would be the way to do this, rather than a union--though it would likely be less efficient than just filtering on the required parameters.

If I'm wrong here, I'd love an explanation of why.

[–] boatswain 2 points 4 months ago (3 children)

UNION is used to append the result of one query to the result of another: https://learn.microsoft.com/en-us/sql/t-sql/language-elements/set-operators-union-transact-sql?view=sql-server-ver17

A UNION concatenates result sets from two queries. But a UNION does not create individual rows from columns gathered from two tables. A JOIN compares columns from two tables, to create result rows composed of columns from two tables.

Your two queries are not equivalent.

[–] boatswain 5 points 4 months ago

Sure seems to be. I see it advertised here and there pretty often.

[–] boatswain 24 points 4 months ago

FYI these vulns were all patched. Source: saw this talk yesterday.

[–] boatswain 4 points 4 months ago

Anyone dealing with health information should definitely be encrypting email address; it's one of the HIPAA identifiers.

[–] boatswain 65 points 4 months ago

Gotta love the EFF. Just threw a bunch of cash to them.

[–] boatswain 101 points 4 months ago (1 children)

This right here. Unions are a much more potent way to tell management "that anti-consumer idea is bullshit and we won't do it."

I've been tech conferencing all week and I've already seen two talks about unionizing tech workers. Maybe the tide is turning?

[–] boatswain 4 points 4 months ago (1 children)

People don't just look at the TV for an hour straight - they are doing other things, or second-screening, or having conversations, and multiple methods being available to pick up on the show dialog is helpful.

Wouldn't this make subtitles less useful rather than more? You can't see the subtitles if you're not just looking at the TV. For second-screening, it would be more helpful to listen to the audio while you're also scrolling Lemmy or whatever.

[–] boatswain 7 points 4 months ago (5 children)

Windmills can do things other than grind flour. Both terms are correct.

[–] boatswain 1 points 4 months ago

Yeah, it sounds like the real problem is lack of off-site backups. Bad password policies will certainly make it easier for ransomware gangs, but they're not the only thing that has to go wrong.

[–] boatswain 2 points 5 months ago (1 children)

When you say "public transit", does that include bus lines, or only rail?

[–] boatswain 3 points 5 months ago (1 children)

I've been really enjoying Kagi.

view more: ‹ prev next ›