mysql: mysterious sideways single quote and IS NOT NULL -
i have 2 queries can run , 2 totally different results, solely because use "sideways single quote" versus single quote. see below:
select * items 'natural' not null will return every record regardless if "natural" column set null
select * items `natural` not null will correctly return records there values set column "natural"
that ain't right.
your first example 'natural' not null tests see if string literal 'natural' not null. since string literals not null, condition true.
the second example tests value of column name natural. want.
related
a string sequence of bytes or characters, enclosed within either single quote (
') or double quote (") characters.
the identifier quote character backtick ( ` )
Comments
Post a Comment