LoginSignup
0
0

More than 1 year has passed since last update.

User ID 検索大、小文字区別方法

Last updated at Posted at 2019-11-20

例:1S999 OK 1s999 NG

★
QLで変更する場合
テーブル作成時
CREATE TABLE `posts` (
	`id` INT(11) PRIMARY KEY AUTO_INCREMENT,
	`name` VARCHAR(100) BINARY,
	...
);

★変更のケース

ALTER TABLE `posts` MODIFY `name` VARCHAR(100) BINARY;
検索時に、フィールドにBINARY演算子を加える

これは一時的な設定です。
SELECT * FROM `posts` WHERE `user_id` = BINARY 'Hoge';    hogeなら、通らない。Hogeの大文字idのみ通る。


0
0
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
0
0