sam2929
asked on
Remove ()
Hi,
I have data like below
Rtyu(aaaa)
Na
Kk(dghk)
I want () to be remove so final output should be
Rtyu
Na
Kk
I have data like below
Rtyu(aaaa)
Na
Kk(dghk)
I want () to be remove so final output should be
Rtyu
Na
Kk
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
@Jim Horn
op wants to remove all content inside (..) as well as brackets, not just remove brackets :)
op wants to remove all content inside (..) as well as brackets, not just remove brackets :)
Aah. Missed that part..
if you want to update your data
update myTable
set data = left(data, CHARINDEX('(',data)-1)
where CHARINDEX('(',data)>0
SELECT LEFT(data, CHARINDEX('(', data + '(') - 1)
select left(filedname,CHARINDEX('(',fieldname + '(')-1) as myvalue from tablename
hi,
ure not saying is in all cases ur datas are ending with ')'. if its not always the case, the SELECT LEFT(data, CHARINDEX('(', data + '(') - 1) will not work
otherwise its quite clever way to do it.
ure not saying is in all cases ur datas are ending with ')'. if its not always the case, the SELECT LEFT(data, CHARINDEX('(', data + '(') - 1) will not work
otherwise its quite clever way to do it.
ure not saying is in all cases ur datas are ending with ')'. if its not always the case, the SELECT LEFT(data, CHARINDEX('(', data + '(') - 1) will not workI have a condition in both select and update version
otherwise its quite clever way to do it.
ID: 42127489
ID: 42127501
when CHARINDEX('(',data)>0 then ... else ...
WHERE CHARINDEX('(',data)>0
im sorry i dont get how its solving it. i mean, if u have f.e. TTT(IUIUU)VVVV or (HHHH)UUUUU and u want to obtain TTTVVVV and UUUUUU, have only what is left of the "(" wil not be ok?
ofc, if ure sure to have in any case only like GGG(UUU) or FFFF, then no worries :)
thats what i was asking, maybe i didnt put it properly :)
ofc, if ure sure to have in any case only like GGG(UUU) or FFFF, then no worries :)
thats what i was asking, maybe i didnt put it properly :)
Open in new window