文章來源:http://www.sqlite.org/lang_keywords.html

任何需要命名的物件都不可以 SQLite keywords 來命名,比如 tables, indices, columns, databases, user-defined functions, collations, virtual table modules 等。也就是一般常用的表格名稱,欄位名稱,都不可以用關鍵字來命名。

如果你堅持要用關鍵字來命名,SQLite 也提供你一些另類的命名方式。

  1. 'keyword'
  2. "keyword"
  3. [keyword] 非標準 SQL 語法,主要是用在 MS ACCSEE/SQL,為了相容才有的。
  4. `keyword` 非標準 SQL 語法,主要是用在 MySQL,為了相容才有的。
ABORT
ACTION
ADD
AFTER
ALL
ALTER
ANALYZE
AND
AS
ASC
ATTACH
AUTOINCREMENT
BEFORE
BEGIN
BETWEEN
BY
CASCADE
CASE
CAST
CHECK
COLLATE
COLUMN
COMMIT
CONFLICT
CONSTRAINT
CREATE
CROSS
CURRENT_DATE
CURRENT_TIME
CURRENT_TIMESTAMP
DATABASE
DEFAULT
DEFERRABLE
DEFERRED
DELETE
DESC
DETACH
DISTINCT
DROP
EACH
ELSE
END
ESCAPE
EXCEPT
EXCLUSIVE
EXISTS
EXPLAIN
FAIL
FOR
FOREIGN
FROM
FULL
GLOB
GROUP
HAVING
IF
IGNORE
IMMEDIATE
IN
INDEX
INDEXED
INITIALLY
INNER
INSERT
INSTEAD
INTERSECT
INTO
IS
ISNULL
JOIN
KEY
LEFT
LIKE
LIMIT
MATCH
NATURAL
NO
NOT
NOTNULL
NULL
OF
OFFSET
ON
OR
ORDER
OUTER
PLAN
PRAGMA
PRIMARY
QUERY
RAISE
REFERENCES
REGEXP
REINDEX
RELEASE
RENAME
REPLACE
RESTRICT
RIGHT
ROLLBACK
ROW
SAVEPOINT
SELECT
SET
TABLE
TEMP
TEMPORARY
THEN
TO
TRANSACTION
TRIGGER
UNION
UNIQUE
UPDATE
USING
VACUUM
VALUES
VIEW
VIRTUAL
WHEN
WHERE

台南小新 發表在 痞客邦 PIXNET 留言(0) 人氣()