May 23, 2018 at 5:41 am
hi,
column containing alphanumeric data. i won't data from column having first five digit is char.
PAN_NO
ACBMX123D6
AZCM4567G8
LKM238GG66
.............
-----------------------
OUTPUT IS
-----------------------
ACBMX123D6
-----------------------
regards
santosh
Best Regards
Santosh Ghogare
May 23, 2018 at 5:47 am
santoshghogare2008 - Wednesday, May 23, 2018 5:41 AMhi,
column containing alphanumeric data. i won't data from column having first five digit is char.PAN_NO
ACBMX123D6
AZCM4567G8
LKM238GG66
.............
-----------------------
OUTPUT IS
-----------------------
ACBMX123D6
-----------------------
regards
santosh
Welcome to SQL Server Central. When posting a question it's helpful to post what you've tried already. If the SQL you've written is almost correct, we can then push you in the right direction. You'll learn much more that way than one of us giving you the answer straight away. 🙂
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
May 23, 2018 at 8:42 am
Maybe using something likeWHERE PAN_NO LIKE '[A-Z][A-Z][A-Z][A-Z][A-Z]%'
You can find more information about searching patterns in here: http://www.sqlservercentral.com/articles/T-SQL/130558/
May 26, 2018 at 4:00 am
Try patindex
where PATINDEX('%[^A-Z]%',LEFT(PAN_NO,5))=0
***The first step is always the hardest *******
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply