2009년 3월 4일 수요일

내가 만든 초성 검색 알고리즘

입력: ㄴㄱ [검색]

mysql> select name from products
    -> where (substring(name,1,1) > '나' and substring(name,1,1) <'다')
    -> and (substring(name,2,1) > '가' and substring(name,2,1) <'나');

결과: 농구티

모 그닥 어렵진 않았음, 이걸 패턴 매칭으로 해도 되는데 귀챦음
노가다가 짱임

댓글 없음:

댓글 쓰기