MySQL中“$”的含义是什么?

时间:2017-06-05 09:49:18

标签: mysql sql

示例:

SELECT * FROM table1 WHERE $.``.age > 20

我试过以下

有效查询:

  • select * from table1 where $.``.age > 20
    
  • select * from table1 where ``.age > 20
    
  • select * from table1 where `table1.age` > 20
    
  • select * from table1 where $$.``.age > 20`
    

无效的查询

       select * from table1 where $.\`table1\`.age > 20 

1 个答案:

答案 0 :(得分:1)

$valid in unquoted identifiers,但就我所知,它没有任何特殊含义。您可以使用任何其他文本复制您的问题:

mysql> select *
    -> from information_schema.engines
    -> where typewhateverhere.``.transactions='YES';
+--------+---------+------------------------------------------------------------+--------------+------+------------+
| ENGINE | SUPPORT | COMMENT                                                    | TRANSACTIONS | XA   | SAVEPOINTS |
+--------+---------+------------------------------------------------------------+--------------+------+------------+
| InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES          | YES  | YES        |
+--------+---------+------------------------------------------------------------+--------------+------+------------+
1 row in set (0.00 sec)

我对MySQL的语法意味着什么并不是最清楚的,但是Identifier Qualifiers似乎没有记录。