Welcome to WebmasterWorld Guest from 3.233.226.151

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

LIKE not working?

     
10:39 pm on Aug 18, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 29, 2003
posts:94
votes: 0


Anyone help, im having problems with a LIKE it simply returns no results on 'a%' searches when the results are there.

example:

SELECT * FROM table WHERE field LIKE 'a%' Returns 0 <==
SELECT * FROM table WHERE field LIKE '%a%' Returns 1
SELECT * FROM table WHERE field LIKE '%a' Returns 1

field = aba

im not sure if its to do with collation,

thanks

10:48 pm on Aug 18, 2005 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 12, 2005
posts:371
votes: 0


askeli,

As far as I can tell, that should be working. My only thought is maybe there is some sort of hidden character at the beginning. If you do a "select length(field) from table;" what length does it return? Beyond that, I'm not sure.

Chad

11:30 pm on Aug 18, 2005 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 29, 2003
posts:94
votes: 0


Tried it, nothing there.

Anyway i played around and found it was only that field the problem lies on, tried recreating the table, same problem, i copied it to a new database and still wouldnt work. so i tried creating a fresh table on a new database and it works ok now?

Strange! thanks for your help, ive kept the old database and will dig deeper tomorrow and try to find whats causing it.

Thanks