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