SQL Syntax Considerations

From LongJump Support Wiki
Revision as of 19:56, 15 December 2011 by imported>Aeric (Created page with "__NOINDEX__ ;Considerations: :* SQL syntax is not case-sensitive, except for table names and field names. :* Backticks are (<tt>`</tt>) are needed around any table or field name …")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Considerations
  • SQL syntax is not case-sensitive, except for table names and field names.
  • Backticks are (`) are needed around any table or field name that is one of the SQL Reserved Words.
For example: SELECT * FROM `Order`
Without the backticks, you get an error like this:
Encountered "Order" at line column 15. Was expecting one of (...
That error means the parser found a word it recognized, but didn't find other things it expected before it got to that word.
  • When either a table name or a field name is reserved word, and both are used together, then backticks are needed around the combination.
For example: `Order.order_number`