|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, March 20, 2013 12:57 AM
Points: 1,870,
Visits: 51
|
|
I did it but it returns 4,4,3. So the answer was wrong!
set ansi_padding on; go
create table #q (v varchar(5) ); go
insert into #q select 'ABC' UNION ALL select 'ABC ' UNION ALL select 'ABC ' UNION ALL select 'ABC '
select * from #q
select COUNT(*) from #q where v = 'ABC'; select COUNT(*) from #q where v = 'ABC '; select COUNT(*) from #q where v LIKE 'ABC ';
drop table #q go
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 3:50 PM
Points: 5,289,
Visits: 7,219
|
|
Pawel Borkowski (12/22/2011) I did it but it returns 4,4,3. You might want to double check the code you typed, and compare it to the code in the original question. Pay extra attention to the number of trailing and leading spaces.
Hugo Kornelis, SQL Server MVP Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, March 20, 2013 12:57 AM
Points: 1,870,
Visits: 51
|
|
How to count spaces on the image? !#$%!$^@#$%@! Can you tell me what was the right count of spaces in this example?
|
|
|
|
|
SSChampion
        
Group: General Forum Members
Last Login: Yesterday @ 4:49 AM
Points: 10,990,
Visits: 10,572
|
|
Pawel Borkowski (12/22/2011) How to count spaces on the image? !#$%!$^@#$%@! Can you tell me what was the right count of spaces in this example?
insert into #q select 'ABC' UNION ALL select 'ABC ' UNION ALL select 'ABC ' UNION ALL select ' ABC '
Paul White SQL Server MVP SQLblog.com @SQL_Kiwi
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Wednesday, March 20, 2013 12:57 AM
Points: 1,870,
Visits: 51
|
|
So I lost the space before :) It changes everything!  Thx
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Friday, February 08, 2013 3:26 AM
Points: 614,
Visits: 54
|
|
Interesting question. Thanks.
|
|
|
|