I needed to write a very simple query using MySQL where I wanted to select all the words in a field in a table (of a database) with a length of 4.
So I typed in the query tab the following and executed the query:
Select * from wordList where length(trim(cWord))='4'
Unfortunately the results of my query gave me all the words that have a length of 3, not 4.
I reran the same query on a similar table in MS Access and got all 4 letter words as asked for, but MySQL is giving me 3. I am new to MySQL so if you know what I am doing wrong, with the above query, let me know. The type of field I am using in MySQL is varchar(45). I also tried same query with MediumText type field and got the same result, 3 letter words with MySQL even tho' I'm asking for 4.
Thanks for any help.
Aimskee
So I typed in the query tab the following and executed the query:
Select * from wordList where length(trim(cWord))='4'
Unfortunately the results of my query gave me all the words that have a length of 3, not 4.
I reran the same query on a similar table in MS Access and got all 4 letter words as asked for, but MySQL is giving me 3. I am new to MySQL so if you know what I am doing wrong, with the above query, let me know. The type of field I am using in MySQL is varchar(45). I also tried same query with MediumText type field and got the same result, 3 letter words with MySQL even tho' I'm asking for 4.
Thanks for any help.
Aimskee