Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

need help select statements

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Is there ever an instance where a select statement will be too "greedy" and disregard case? Ex, table contains a cell with text:

'FieldData'

The following statement should return an empty set:

"SELECT from
WHERE [column] = 'FIELDDATA'"

, correct? because the cases dont match, mysql should return a null set, right? Well, what if it doesnt, what would cause that, and how would I get mysql to be more strict so that case would matter? Pls help.

thanx.
 
It depends on your column type, and how you create the column. From the MySQL manual:


"Values in CHAR and VARCHAR columns are sorted and compared in case-insensitive fashion, unless the BINARY attribute was specified when the table was created. The BINARY attribute means that column values are sorted and compared in case-sensitive fashion according to the ASCII order of the machine where the MySQL server is running. BINARY doesn't affect how the column is stored or retrieved."


"The four TEXT types TINYTEXT, TEXT, MEDIUMTEXT, and LONGTEXT correspond to the four BLOB types and have the same maximum lengths and storage requirements. The only difference between BLOB and TEXT types is that sorting and comparison is performed in case-sensitive fashion for BLOB values and case-insensitive fashion for TEXT values. In other words, a TEXT is a case-insensitive BLOB."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top