Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,658 members, 7,820,309 topics. Date: Tuesday, 07 May 2024 at 12:53 PM

Help! Using Update Statement To Replace All NULL Value In A Column In Mysql - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Help! Using Update Statement To Replace All NULL Value In A Column In Mysql (431 Views)

HELP ME Error Parsing XML, Line 15, Column 70: The Entity "Raquo" Was Referenced / How To Fill Bank Information Column On Clickbank / How To Fix Annoying Opera Mini Single Column View And Similar Browsers Issues (2) (3) (4)

(1) (Reply)

Help! Using Update Statement To Replace All NULL Value In A Column In Mysql by uvalued(m): 2:16am On Aug 27, 2015
am stuck. I have this database table that have
20,000+ rows. A COLUMN PAYMENT has some data and most
of it with the NULL value. So i want to update all NULL in the PAYMENT
COLUMN with value from say CREDIT COLUMN.

I used something like this

UPDATE table
SET

PAYMENT = CREDIT

WHERE PAYMENT IS NULL;

it did not work can someone help?

thanks
Re: Help! Using Update Statement To Replace All NULL Value In A Column In Mysql by talk2hb1(m): 6:34am On Aug 27, 2015
Its like you never specify the unique id of the row you intend to update
Re: Help! Using Update Statement To Replace All NULL Value In A Column In Mysql by JackOfAllTrades: 8:07am On Aug 27, 2015
Use this query instead
Update table SET `payment` = 'credit' WHERE `payment` = 'Null';

1 Like

(1) (Reply)

Get An Android App With Adsense For Your Blog - Increase Traffic And Earnings / How Can I Buy A Domain For Myblogaccount On Google / 33k Facebook Group Is Up For Sale At 3k

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.