I have an SQL statement:
SELECT * FROM customers WHERE BINARY login='xxx' AND password='yyyy'
There are no blob/binary fields in the table, do I need the BINARY after the WHERE what else does it do?
The MySQL BINARY function is used for converting a value to a binary string. The BINARY function can also be implemented using CAST function as CAST(value AS BINARY). The BINARY function accepts one parameter which is the value to be converted and returns a binary string.
Binary, Varbinary & Varbinary(max) are the binary string data types in SQL Server. These data types are used to store raw binary data up to a length of (32K – 1) bytes. The contents of image files (BMP, TIFF, GIF, or JPEG format files), word files, text files, etc. are examples of binary data.
Binary data is a type of data that is represented or displayed in the binary numeral system. Binary data is the only category of data that can be directly understood and executed by a computer. It is numerically represented by a combination of zeros and ones.
The VARBINARY(MAX) field allocates variable length data up to just under 2GB in size. You can use DATALENGTH() function to determine the length of the column content.
BINARY
is a built-in keyword that after your WHERE
clause that forces a comparison for an exact case-sensitive match.
As a side note, you can also make columns case-sensitive by adding the BINARY
keyword when you create your table.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With