Find the Maximum AlphaNumeric number in SQL

by 7:27 PM 0 comments
Hello friends i came with the new post for searching the maximum primary key that is alphanumerical..

so here is the tips to get the maximum alphanumeric value....

Select 'prefix' + convert(varchar(20), max(convert(int, substring(AlphNumField, 4, 100))) + 0) from TableName

now if we want the incremented alphanumeric value then see this one..!


Select 'prefix' + convert(varchar(20), max(convert(int, substring(AlphNumField, 4, 100))) + 1) from TableName 

i hope it would be helpful to you friends...thanks

ravi tuwar

Developer

Cras justo odio, dapibus ac facilisis in, egestas eget quam. Curabitur blandit tempus porttitor. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

0 comments:

Post a Comment