Perhaps because underscore is considered to be a wild-card search character.

Take a look at: http://sqlite.org/lang_expr.html#like

If you want to match underscore literally, use an optional escape character 
clause and escape the underscore.

-Allan

> -----Original Message-----
> From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] On Behalf Of Wilson, Ronald
> Sent: Tuesday, March 02, 2010 10:41 AM
> To: General Discussion of SQLite Database
> Subject: [sqlite] why is underscore like dash?
> 
> This test was performed on Windows XP:
> 
> PS C:\Documents and Settings\ma088024> sqlite3
> SQLite version 3.6.22
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> create table test (text);
> sqlite> insert into test values('_');
> sqlite> insert into test values('-');
> sqlite> select * from test where text like '-';
> -
> sqlite> select * from test where text like '_';
> _
> -
> sqlite> .quit
> 
> RW
> 
> Ron Wilson, Engineering Project Lead
> (o) 434.455.6453, (m) 434.851.1612, www.harris.com
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to