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 5959453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:41:12+00:00 2026-05-22T18:41:12+00:00

I am having a table which has about 17 fields. I need to perform

  • 0

I am having a table which has about 17 fields. I need to perform frequent updates in this table. But the issue is each time I may be updating only a few fields. Whats the best way to write a query for updating in such a scenario? I am looking for an option in which the value gets updated only if it is not null.

For example I have four fields in database Say A,B,C,D.
User updates the value of say D. All other values remains the same. So I want an update query which updates only the value of D keeping the others unaltered.
SO if i put a,b and c as null and d with the value supplied by user I want to write an update query which only updates the value of d as a,b and c is null.
Is it something achievable?

I am using SQLite database.

Could someone please throw some light into it?

  • 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-05-22T18:41:13+00:00Added an answer on May 22, 2026 at 6:41 pm

    Without knowing your database it’s tough to be specific. In SQL Server the syntax would be something like …

    UPDATE MyTable 
    SET 
            Field1 = IsNull(@Field1, Field1),
            Field2 = IsNull(@Field2, Field2),
            Field3 = IsNull(@Field3, Field3)
    WHERE 
         <your criteria here>
    

    EDIT

    Since you specified SQLLite …replace my IsNull function with COALESCE() or alternately look at the IfNull function.

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

Sidebar

Related Questions

I have a table in database that is having some fields one of which
I have a table which has a foreign key referencing itself. This would be
I have a MySQL table which has about 30 columns. One column has empty
This has been bugging me for about 4 hours, so I thought it's time
I'm having a table in which i'm creating a label dynamically. '<td>' + '<label
I am having trouble with Subsonic 3.0 generating an object for a table which
I'm having a table and i have a row which is initially set to
I am having a table with records like this in MS Access: ID field2
I have a nice clean UI within a table view which has a few
I have a table which needs 2 fields. One will be a foreign key,

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.