database.sarang.net
UserID
Passwd
Database
DBMS
ㆍMySQL
PostgreSQL
Firebird
Oracle
Informix
Sybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
MySQL Q&A 197 게시물 읽기
No. 197
# Re: # DB검색시 대소문자를 구별해서 검색하는 방법을 알려주세요
작성자
문태준
작성일
1999-12-03 19:46
조회수
13,394

> MySQL에서 DB검색시 대소문자를 구별해서 검색하는 방법을 알고싶습니다.

>

> 지금 msql에서 사용하던 데이터를 MySQL로 옮겨왔는데 대소문자

> 구별없이 검색이되서 엄청난 혼란이 야기되고 있습니다.

>

> 제발 MySQL에서 대소문자 구별해서 검색하는 방법을 자세히 알려주십시요....

>

> 제가 왕초보라는것을 감안 하셔서 되도록이면 쉽게 설명해주시면 감사하겠습니다.

>

 

 

18.14 Case sensitivity in searches

By default, MySQL searches are case-insensitive (although there are some character sets that are never case insensitive, such as czech). That means that if you search with col_name LIKE 'a%', you will get all column values that start with A or a. If you want to make this search case-sensitive, use something like INDEX(col_name, "A")=0 to check a prefix. Or use STRCMP(col_name, "A") = 0 if the column value must be exactly "A".

 

Simple comparison operations (>=, >, = , < , <=, sorting and grouping) are based on each character's ``sort value''. Characters with the same sort value (like E, e and 'e) are treated as the same character!

 

LIKE comparisons are done on the uppercase value of each character (E == e but E <> 'e)

 

If you want a column always to be treated in case-sensitive fashion, declare it as BINARY. See section 7.7 CREATE TABLE syntax.

 

If you are using Chinese data in the so-called big5 encoding, you want to make all character columns BINARY. This works because the sorting order of big5 encoding characters is based on the order of ASCII codes.

 

 

-->> 편하게 하려면 아예 테이블 생성시부터 대소문자를 구별하지 않도록 생성하면 됩니다.

 

create table 참고하세요.

 

7.7 CREATE TABLE syntax

[Top]
No.
제목
작성자
작성일
조회
203mysql에서 테이블구조에 대해서
crazyman
1999-12-05
12497
205┕># Re: mysql에서 테이블구조에 대해서
문태준
1999-12-06 09:53:50
12950
202# [이정환 님께] 질문의 답변에 대한 감사의 글
hamlet
1999-12-05
11907
198# [질문] mysql db서버와 php를 모듈화해서 작동하는 아파치 웹서와 연동시..
태후니
1999-12-04
12259
201┕>Re: [질문] mysql db서버와 php를 모듈화해서 작동하는 아파치 웹서와 연동시..
정재익
1999-12-04 16:11:54
13399
204┕>Re: # [질문] mysql db서버와 php를 모듈화해서 작동하는 아파치 웹서와 연동시..
이정환
1999-12-05 21:41:10
12882
196# DB검색시 대소문자를 구별해서 검색하는 방법을 알려주세요
이상림
1999-12-03
12311
197┕># Re: # DB검색시 대소문자를 구별해서 검색하는 방법을 알려주세요
문태준
1999-12-03 19:46:38
13394
191# 리모트연결이 정말 않되요. 정말 급합니다...
가이버
1999-12-02
12164
193┕>Re: # 리모트연결이 정말 않되요. 정말 급합니다...
이정환
1999-12-03 11:15:52
12821
190# 프린터 문제
1999-12-02
11882
199┕># Re: # 프린터 문제
문태준
1999-12-04 12:16:37
12655
189# Mysql을 설치하는데 다음과 같은 에러메세지가 나옵니다. 아시는 분은 ...
Hamlet
1999-12-02
12618
194┕>Re: # Mysql을 설치하는데 다음과 같은 에러메세지가 나옵니다. 아시는 분은 ...
이정환
1999-12-03 11:21:04
13077
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2023 DSN, All rights reserved.
작업시간: 0.051초, 이곳 서비스는
	PostgreSQL v16.1로 자료를 관리합니다