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 |
|
keyursoni85
Posting Yak Master
233 Posts |
Posted - 2011-04-15 : 03:51:09
|
Hi,I have two type of data in different tables asColumnA ColumnB18, Sas Garden 385748 18, Sas Garden 385748 I need to compare above data and those data should be equal..Can anyone help me in above situationSpace will occur more than one but i need to consider only oneThank you in advance.. |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2011-04-15 : 04:09:10
|
[code]declare @ColumnA varchar(255)declare @ColumnB varchar(255)set @ColumnA = '18, Sas Garden 385748'set @ColumnB = '18, Sas Garden 385748'select @ColumnA, @ColumnBwhere @ColumnA <> @ColumnBselect @ColumnA, @ColumnB,replace(replace(replace(@ColumnA,' ','~# '),' ~#',''),'~#',''),replace(replace(replace(@ColumnB,' ','~# '),' ~#',''),'~#','')where replace(replace(replace(@ColumnA,' ','~# '),' ~#',''),'~#','') = replace(replace(replace(@ColumnB,' ','~# '),' ~#',''),'~#','')[/code] No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
keyursoni85
Posting Yak Master
233 Posts |
Posted - 2011-04-15 : 05:22:40
|
| Thank you webfred..:) |
 |
|
|
|
|
|
|
|