Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9263221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T13:32:02+00:00 2026-06-18T13:32:02+00:00

I recently began teaching myself (terrible) SQLite. One thing that struck me as annoying

  • 0

I recently began teaching myself (terrible) SQLite. One thing that struck me as annoying was the CASE expression, namely the fact that it employs short-circuit evaluation.

Is there any way to get around this? I am looking for a CASE statement that does not employ short-circuit evaluation.

UPDATE [table]SET [counting_column] =

(
CASE
    when [column1] = NULL 
    then [counting_column] + 1

    ...

    when [column31] = NULL
    then [counting_column] + 1
end
)

I would like each entry in the database to be tested by each case statement, not just the first one that evaluates to true. Any help would be much appreciated.

NOTE: I apologize if there’s some glaring error– I’m quite new at this so go easy please.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T13:32:03+00:00Added an answer on June 18, 2026 at 1:32 pm

    If you are indeed just adding 1 to counting_column for each condition that is met, you can use a chain of n CASE statements and add the results together. Each individual CASE supplies a 0 or 1, all of which are added together and added to the current value of counting_column.

    UPDATE [table] SET [counting_column] =
    (
      [counting_column] + 
      (CASE when [column1] IS NULL then 1 ELSE 0 END) +
      (CASE when [column2] IS NULL then 1 ELSE 0 END) +
        ...
        ...
      (CASE when [column30] IS NULL then 1 ELSE 0 END) +
      (CASE when [column31] IS NULL then 1 ELSE 0 END)
    )
    

    Note that I have changed the = NULL to IS NULL. NULL is a special non-value that cannot be compared with an equality =.

    I’ll also point out that although [] enclosed identifiers are ok in SQLite, this is mostly for compatibility with T-SQL. The more standard approach is to use double-quotes as in UPDATE "table" SET "counting_column" = ...

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One of the FTP accounts that I use recently began requiring secure FTP connections,
I've noticed that recently sites began to keep images in one big image. For
I recently began working on a large project that contains a huge number of
I began studying Java Regular Expression recently and I found some really intersting task.For
I recently began attempting to develop a simple Wordpress theme for myself, and have
I recently began exploring indexing in sqlite. I'm able to successfully create an index
I recently began doing facebook application development. But it seems that the information out
I've recently started to use SQLite and began to integrate it into a C#
I recently began digging into the South documentation and discovered that it had two
I recently began working with Boost Asio. I noticed that the receive method of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.