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 |
|
goligol
Posting Yak Master
128 Posts |
Posted - 2011-06-29 : 17:52:26
|
| In my query from table [cf07ur00].[comm], I want to find the comm where their length is not 4 and also if their length is 3, their first digit in right is not 0.Out of the tablecomm010100100020210210022I want to have:CC0102021022SELECT [comm] CC FROM [bts].[cf07ur00].[comm] where LEN(comm) <> 4 and RIGHT (comm,1)!= 0 when len(comm) = 3 |
|
|
singularity
Posting Yak Master
153 Posts |
Posted - 2011-06-29 : 19:16:04
|
| [code]SELECT [comm] CCFROM [bts].[cf07ur00].[comm]where LEN(comm) <> 4 and not (RIGHT(comm,1) = 0 and len(comm) = 3)[/code] |
 |
|
|
goligol
Posting Yak Master
128 Posts |
Posted - 2011-06-30 : 12:13:13
|
| Thank you |
 |
|
|
|
|
|