Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
INSERT INTO table_a (col_tinyint, col_varchar) SELECT 0, distinct(col_other_varchar) COLLATE utf8_bin FROM table_b
我想从 table_b 中区分并区分大小写,但此查询会产生错误。我该如何解决这个问题?
我得到错误:
错误是 SQL 语法 #1064
DISTINCT关键字必须紧跟在之后SELECT。
DISTINCT
SELECT
您还应该知道,它适用于整行而不是单个列,无论您可能选择添加任何括号。
INSERT INTO table_a (col_tinyint, col_varchar) SELECT DISTINCT 0, col_other_varchar COLLATE utf8_bin FROM table_b