Mysql statement help

NamecheapNamecheap
Watch

teclance

Established Member
Impact
1
Hey,

I am running OSC and I need to issue a MYSQl statement to the effect of:

products_model = products_id ONLY if the products_model field is blank.

In other words, if there is ALREADY a product model, it should be left alone. If there is NOT one already then it should be set to the products_id.

Does any one have a suggestion of how to do this?


thanks a bunch
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
update table_name set products_model = products_id where products_model is null

or depending on what you consider blank

update table_name set products_model = products_id where products_model = ''
 
0
•••
thanks a bunch for that I will give it a shot.
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back