Link to home
Start Free TrialLog in
Avatar of parpaa
parpaa

asked on

Replace

Hi all,

Please find the attachment,

I have a requirement where I need to replace the ISDN values into PRI from the Tag Column
I guess we have something like this select replace([tag_col],'ISDN','PRI') from tablename. this works fine.

I have another requirement where rest of the values in the tag_col should go null/blank.
It means I should have tag_col with 'PRI'  only.

please help out.
thanks in adv
test.xlsx
Avatar of RGBDart
RGBDart
Flag of Russian Federation image

just add

where replace([tag_col],'ISDN','PRI') = 'PRI'
[telepathy mode = on]
May be you want update items in that table, not select from it?
[telepathy mode = off]
If yes, query will be different
Avatar of parpaa
parpaa

ASKER


@RGB many thanks for your sugg,
What if I want to update the table?? how the query will be?
Avatar of Ephraim Wangoya


update table
set tag_col = 'PRI'
where tag_col = 'ISDN'
Avatar of parpaa

ASKER

UPDATE TABLE
SET TAG_COL ='PRI'
WHERE TAG_COL='ISDN'

what if I want rest of the records in the TAG_COL column be null ?
SOLUTION
Avatar of Ephraim Wangoya
Ephraim Wangoya
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of parpaa

ASKER

Highly appreciated for your efforts and suggestions. Thank you so much.