If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
Use REPLACE, the trick is that you must have a primary key or a unique index on the table. This command will replace rows with the same unique index or insert the row like normal. You can use it just like an INSERT.
Quote:
Originally posted by bobwilli
Is there a way to set the value for a particula column data using only SELECT statement?
ex.
update TABLE set COLUMN = value where COULMNX = value ;
instead of this, I need to use only a SELECT statement to do the same function.
Originally posted by aus
Use REPLACE, the trick is that you must have a primary key or a unique index on the table. This command will replace rows with the same unique index or insert the row like normal. You can use it just like an INSERT.
Oh, that's great, I didn't kow about this function .