tags:

views:

10

answers:

1

Hi, I have to query a column containing a Binary column with data like this ®â{Õ■K!Eòû▓♫;#§ø.

How can i query this colmn..if I wanted something like:

SELECT Name FROM Users WHERE ID = ®â{Õ■K!Eòû▓♫;#§ø

THanks

A: 

Several RDBMS (I thinks at least MySQL ans MS SQL Server) use the 0x………… notation where you put 0x + your binary bytes in hexadecimal pairs, e.g. SELECT Name FROM Users WHERE ID = 0x402041 matches id '@ A'.

PostGreSQL uses escaping and the bytea type.

I've also read something about the format X'402041'.

This is depedent on your SQL flavour, you should check the corresponding documentation for "binary litterals" or "binary strings".

streetpc