Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
Here is a table "table1" with a char(5) column "col1"the value in col1 looks like this: 12345 23568 01235the value of col consists of numberif I wanner get a char(5) result that every digit of this valueshould be the max of the value of col at the same digit,how to?I have thought this for about a week?Maybe it is a mission impossible?I do not know what is what
If you have values that are less then 5 characters long and you want to treat them as right-aligned, replace col1 in Arnold's statement with (REPLICATE(' ', 5-LEN(col1))+col1)to pad the value with spaces.
p2bl
Yak Posting Veteran
54 Posts
Posted - 2001-11-30 : 08:33:40
Ha ha.So simple!I find myself a idiot!Thanks a lotI do not know what is what