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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:57:55+00:00 2026-05-26T22:57:55+00:00

I added a column to an existing table. Now I need to update the

  • 0

I added a column to an existing table. Now I need to update the tablecontent by adding a MD5 hash to that new column, based on the content of an existing column.

To be more precise:

id | name | date-of-birth | hash
1  | test | 12.12.12      | NULL

There are more than 1 million rows, where hash = NULL. Now I need to update hash with a MD5 string, that is bases on a corresponding column e.g. name:
hash = MD5(test)

I know how to do it for a single row. But how to do that for all rows in a single SQL Statement?

  • 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-26T22:57:55+00:00Added an answer on May 26, 2026 at 10:57 pm

    Try this:

    UPDATE yourtable
    SET hash = MD5(name)
    WHERE hash IS NULL
    

    Note that the test is hash IS NULL and not hash = NULL as you wrote in your question.

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

Sidebar

Related Questions

I have added a new enum column, enum('true','false') in an existing MySQL table. What
I have a table where I have added a new column, and I want
When using Linq-to-SQL, adding a column to an existing table, and setting a default
I have a table with 2 varchar2 columns. I have added new number column
I have an existing table in an Oracle 10gR2 that I added a XMLTYPE
I have a gridview that I have added a checkbox column using a templatefield
I manually added a column to a table in a .dbml file by editing
Update: Added Schema to the bottom... I have a table of contracts: tbl_contract And
I have counter for unique column in my table. Now I have list where
I would like to know how to update an existing pivot table data source.

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.