List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:September 9 2004 6:36pm
Subject:Re: when to use backquote in SQL
View as plain text  
In the last episode (Sep 09), Fagyal Csongor said:
> Dan Nelson wrote:
> >In the last episode (Sep 09), leegold said:
> >>Could anyone link me or explain the purposes of backquotes in an
> >>SQL statement. I tried searching the manual and googling it but
> >>couldn't find a simple explaination. ``` vs. "regular" single
> >>quotes'''. Thanks, Lee G.
> >
> >Backquotes are used to delimit table or field names; they aren't
> >used to delimit SQL strings the way ' or " are.  You'll almost never
> >need to use them unless you have spaces or other strange characters
> >in your table/field names.
>
> ...or when you chose a reserved MySQL keyword as a column name  - for 
> example.
> 
> ...which might happen automatically when you upgrade to a new version of 
> MySQL :-)) Your column name suddenly becoming a keyword is a _lot_
> ;-), fun so 'don't forget your backticks'.

I forgot about that case, which is probably why glue drivers like
MyODBC end up quoting everything.

-- 
	Dan Nelson
	dnelson@stripped
Thread
fulltext usage for specific keywordsleegold7 Sep
  • Re: fulltext usage for specific keywordsThomas Spahni7 Sep
  • Re: fulltext usage for specific keywordsSGreen7 Sep
    • when to use backquote in SQLleegold9 Sep
      • Re: when to use backquote in SQLDan Nelson9 Sep
        • Re: when to use backquote in SQLFagyal Csongor9 Sep
          • Re: when to use backquote in SQLDan Nelson9 Sep
      • Re: when to use backquote in SQLSGreen9 Sep
    • Re: when to use backquote in SQLJim Grill9 Sep