SQLTeam.com | Weblogs | Forums

Confused with showing an original and modified version or a table


#1

Hi all,

The question is
write a query to view the original string in customers.state, beside a modified version of customers.state where 'California' is replaced by 'CA'

I have no clue how to view the original and the modified beside one another
the best i cam eup with was

alter table customers
add state varchar
set customers.state = replace(state, 'CA', 'California');

I know it's incorrect
can anyone help me or guide me please?

thanks so much


#2

Ask the professor for clarification. Who/what replaced the data? What is the current table schema? Are you going to write query to modify the data or has someone already modified the data?


#3

I have to write the query to modify the data and then display both the original and modified versions next to each other


#4

i think it is not asking for a update statement. Just a SELECT showing original and "modified" side by side