The “IF COUNT = 1” Conundrum

  • Post comments:19 Comments
  • Reading time:10 mins read

If you haven’t read my yesterday’s post, then do that first.

Good. At this point you are extremely smart because you know that you should never use COUNT = 0 but should use ISEMPTY instead.

However, what if:

IF SomeTable.COUNT = 1 THEN
  DoSomething();

Well, if this is what you need, then that’s what you need. And that’s exactly what we needed in the team a few days ago.

(more…)

Continue ReadingThe “IF COUNT = 1” Conundrum

Are there any records there?

  • Post comments:11 Comments
  • Reading time:5 mins read

It’s been a while that I haven’t blogged, and my queue grows inversely proportional to the amount of time I have available for blogging, so let me do a short series of easy stuff, simply to take it off the list.

This is not about new features, crazy new tips and tricks or anything of the sort. It’s just a couple short lessons on performance and how to reduce your carbon footprint and make the planet last longer.

It’s about how to properly ask the database: are there any records there?

(more…)

Continue ReadingAre there any records there?