sql等价于memsql query for mysql query

mitkmikd  于 2021-06-18  发布在  Mysql
关注(0)|答案(1)|浏览(440)

任何人都可以帮我把下面的mysql查询转换成memsql查询。

SELECT TABLE_SCHEMA AS `schema`, TABLE_NAME AS `name`
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME COLLATE utf8_general_ci IN (N'Record')
  AND TABLE_SCHEMA = 'test'

需要解决以下错误
[错误]code:1064 sql state:42000]sql语法有错误;检查与您的mysql服务器版本相对应的手册,以获得在第1行的“collate utf8\u general\u ci in(n'record')和table\u schema='test''附近使用的正确语法

uttx8gqw

uttx8gqw1#

你可以用

SELECT TABLE_SCHEMA AS `schema`, TABLE_NAME AS `name`
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME IN ('Record')
  AND TABLE_SCHEMA = 'test';

区分大小写,或者

SELECT TABLE_SCHEMA AS `schema`, TABLE_NAME AS `name`
FROM INFORMATION_SCHEMA.TABLES
WHERE lower(TABLE_NAME) IN ('record')
  AND TABLE_SCHEMA = 'test';

不区分大小写。
那里不支持collate子句,也不支持n'string'。

相关问题