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 am having some 10 lac records in my single SQL Table. I need
Having a table with a column like: mydate DATETIME ... I have a query
I am having a table Table1 with columns id1, id2, id3 all the columns
Using MySQL syntax and having a table with a row like: mydate DATETIME NULL,
I would like to search my table having a column of first names and
I am having problems getting text within a table to appear centered in IE.
I have the following query: select column_name, count(column_name) from table group by column_name having
I have the following code: SELECT <column>, count(*) FROM <table> GROUP BY <column> HAVING
Consider two tables transaction and category each having their own ID and information. A
Having difficulty articulating this correlated subquery. I have two tables fictitious tables, foo and

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.