December 19, 2011 at 4:06 pm
Superb question.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
December 19, 2011 at 5:41 pm
Thanks for all of the compliments everyone.
I ran into this scenario and as it seemed contradictory to common sense to me, I figured I'd see if I was the only one who thought that.
Given 2/3 rds of responders got it wrong, I guess not. :w00t:
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgDecember 20, 2011 at 3:57 am
Nice one, thank you
Iulian
December 20, 2011 at 5:24 am
Good question, thanks for submitting.
http://brittcluff.blogspot.com/
December 20, 2011 at 9:09 am
tks - great question
December 22, 2011 at 1:54 am
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
December 22, 2011 at 2:48 am
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.
December 22, 2011 at 3:02 am
How to count spaces on the image? !#$%!$^@#$%@!
Can you tell me what was the right count of spaces in this example?
December 22, 2011 at 3:35 am
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
SQLPerformance.com
SQLkiwi blog
@SQL_Kiwi
December 22, 2011 at 3:58 am
So I lost the space before 🙂
It changes everything! :w00t:
Thx
January 5, 2012 at 3:51 am
Interesting question. Thanks.
Viewing 11 posts - 16 through 25 (of 25 total)
You must be logged in to reply to this topic. Login to reply