5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

照合順序がCI(大文字小文字区別しない)なのに、大文字小文字区別して検索したい

Posted at

COLLATEを指定して検索すればOK。

SELECT *
FROM   [テーブル名]
WHERE  [項目名] = '[値]' COLLATE [照合順序]
オプション 説明 区別対象
CI / CS 大文字と小文字を区別しない/する。 「A」と「a」
AI / AS アクセント、濁音、半濁音を区別しない/する。 「は」と「ば」と「ぱ」
(KIの指定はない) / KS ひらがなとカタカナを区別しない/する。 「あ」と「ア」
(WIの指定はない) / WS  半角と全角を区別しない/する。 「A」と「A」|
SELECT *
FROM   TableA
WHERE  Col1 LIKE '%a%'
COLLATE Japanese_XJIS_100_CS_AS
5
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
7

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?