Lynskey08 :
I'm trying to modify one of my queries to select all values in the db, but also replace all values that are either NULL or "-" in the column "RA" with the value "No RA".
Select *,
IF(RA IS NULL OR RA='-', 'No RA', RA)
from dbname
When I do the above command, it's replacing the values but it replaces them in a newly created column called "IF(RA IS NULL OR RA='-', 'No RA', RA)". How can I do by only modifying the existing RA column?
Thank you for your time.
scaisEdge :
just don't use select * but use a proper select using explicit column name for all the columns you need
Select IF(RA IS NULL OR RA='-', 'No RA', RA) RA, col2, col3
from dbname