SQL Select statement - The thing i am querying for has a single quotation mark -
hi new stackoverflow , sql. not sure how phrase title google not helpful.
i doing simple select query:
select * department departmentname = "controller's office"
i return results has departmentname of "controller's office". name has single quotation must not removed(because boss said so). using single quotation marks not work. , returns error:
invalid column name 'controller's office'.
how can query works? if doing complicated please explain because new thanks!
most variants of sql (you don't specify using) let escape single quotes using another single quote:
select * department departmentname = 'controller''s office'
double quotes (in of variants of sql know) used delimit identifiers (column , table names) contain characters not otherwise valid in identifier's name.
Comments
Post a Comment