I have a database table called patient. Which has a field called account_id [char](12)NULL.
My question is when I use this query and it works.
select last_name from patient
where account_id = ' 12416'
Results :
last_name
------------------
Todd
(1 row(s) affected)
But if I use this query:
select last_name from patient
where account_id = '12416'
Results :
last_name
------------------
(0 row(s) affected)
Why does one work and not the other. Do the spaces get stored in the database? I understand that " 12416" is different than "12416" but does the query only look for the numbers not the spaces?
Thanks
My question is when I use this query and it works.
select last_name from patient
where account_id = ' 12416'
Results :
last_name
------------------
Todd
(1 row(s) affected)
But if I use this query:
select last_name from patient
where account_id = '12416'
Results :
last_name
------------------
(0 row(s) affected)
Why does one work and not the other. Do the spaces get stored in the database? I understand that " 12416" is different than "12416" but does the query only look for the numbers not the spaces?
Thanks