Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jscot
Posting Yak Master
106 Posts |
Posted - 2011-02-23 : 21:10:40
|
| Hi guys, I have sample data like thisR43567J45678Question:- I want to delete R & J front of each rows. Please guide me how i can fix this issue. Thanks. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
chris_n_osborne
Starting Member
34 Posts |
Posted - 2011-02-23 : 21:39:06
|
| [code]CREATE TABLE #test(textcol NVARCHAR(6))goINSERT INTO #test(textcol)SELECT 'R43567' UNION ALLSELECT 'J45678'goSELECT * FROM #testUPDATE #test SET textcol = CASE WHEN LEFT(textcol, 1) = 'R' THEN RIGHT(textcol, 5) WHEN LEFT(textcol, 1) = 'J' THEN RIGHT(textcol, 5) ENDSELECT * FROM #testgotextcol-------R43567J45678textcol-------4356745678[/code] |
 |
|
|
jscot
Posting Yak Master
106 Posts |
Posted - 2011-02-24 : 00:11:12
|
| All First Characters and i have 65k rows in my table. |
 |
|
|
MIK_2008
Master Smack Fu Yak Hacker
1054 Posts |
Posted - 2011-02-24 : 00:14:13
|
| is this what you are looking for?Select Substring(ColumnName,2,len(ColumnName)) From TableNameCheersMIK |
 |
|
|
|
|
|