Mariano DAngelo
Mariano DAngelo

Reputation: 940

Replace char in column

I'm trying to delete the char . from a column in a table.

Column = n_license table = fighters_fighter

Query I'm trying to use:

UPDATE `fighters_fighter` SET `n_license` = REPLACE (`n_license`,`.`,``);

Error:

1054 - Unknown column '.' in 'field list'

Which could be the problem?

Upvotes: 2

Views: 39

Answers (2)

Matt
Matt

Reputation: 15061

Wrong quotes on the characters.

UPDATE fighters_fighter 
SET n_license = REPLACE (n_license,'.','');

Upvotes: 0

Abhik Chakraborty
Abhik Chakraborty

Reputation: 44844

The char should be enclosed within '' not the ``

UPDATE `fighters_fighter` 
SET `n_license` = REPLACE (`n_license`,'.','');

Upvotes: 2

Related Questions