1

Topic: What of conditions will be false

Faced a following question:
***
What of conditions will be false?
SELECT
' a ' = ' a ' as ' 1 ';
' a ' LIKE ' a ' as ' 2 ';
' a ' = ' A ' as ' 3 ';
' a ' LIKE ' A ' as ' 4 ';
***
Prompt, please, what answer to this question.

2

Re: What of conditions will be false

1 -  it is true.
2 -  it is false.
3, 4 - depending on collation it is true or false.

3

Re: What of conditions will be false

PS. Provided that everywhere in literals the same letter (for example, Latin "and"). If there different, but similar on a spelling, characters - that guaranteed FALSE.

4

Re: What of conditions will be false

Akina wrote:

1 -  it is true.
2 -  it is false.
3, 4 - depending on collation it is true or false.

Can explain, why so in first two variants?

5

Re: What of conditions will be false

1) According to the documentation, at comparing by the operator "=" string literals tail gaps are cut off.
2) According to the documentation, at comparing by operator "LIKE" of string literals all characters of a template are significant.
And generally - well simply esteem the documentation. At least...

6

Re: What of conditions will be false

Akina;
I thank for answers.