vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I have a table with about 41k rows with 10 columns, one titled "Gender", the options being M, F, and U of text data type. When I query against this table: SELECT * FROM `table` WHERE 'Gender' = 'M' It returns no records. If I change the query to: SELECT * FROM `table` WHERE 'Gender' != 'M' It returns all records, including those with 'M' in them. Regardless of the WHERE 'Gender' clause, i.e. U, M, F, or NULL, I get the same behavior. I really would like to avoid performing manual operations on 41,000 records but need to change the value of NULL or blank 'Gender' to 'U'. I've checked whitespace and have determined that there is none involved, so far as these queries go. Any advice would be appreciated. -- Regards, Jeff Gardner ___________________________ "Contrary to popular belief, Unix is user friendly. It just happens to be very selective about who its friends are." --Kyle Hearn |
| ||||
| You are comparing the string 'Gender' with the string 'M', not the _field_ Gender. Jeff Gardner wrote: > I have a table with about 41k rows with 10 columns, one titled "Gender", > the options being M, F, and U of text data type. When I query against > this table: > > SELECT * > FROM `table` > WHERE 'Gender' = 'M' > > It returns no records. If I change the query to: > > SELECT * > FROM `table` > WHERE 'Gender' != 'M' > > It returns all records, including those with 'M' in them. Regardless of > the WHERE 'Gender' clause, i.e. U, M, F, or NULL, I get the same > behavior. I really would like to avoid performing manual operations on > 41,000 records but need to change the value of NULL or blank 'Gender' to > 'U'. I've checked whitespace and have determined that there is none > involved, so far as these queries go. Any advice would be appreciated. |