Hi,
Your solution converts the binary field to a string and then compares two
strings. You should get rid of any conversion problems by comparing the
values as binary data:
SELECT * FROM table1 WHERE field1 = BINARY 0x61006200630064000000;
--
Mikko Noromaa (mikkon@stripped)
- SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -
> -----Original Message-----
> From: Koh Swee Meng [mailto:swee_meng@stripped]
> Sent: Tuesday, July 08, 2003 6:07 AM
> To: mysql@stripped
> Subject: Re: "select * from table where field=hex" doesnt work
>
>
> oh, i found the solution for this,
> by doing "SELECT * FROM table1 WHERE STRCMP(field1,
> 0x61006200630064000000)=0" will work as expected, so no need
> to worry that
> character %(ASCII 25) will cause any problem.
>
>
> Regards,
> Koh Swee Meng
>
>
> ----- Original Message -----
> From: "Koh Swee Meng" <swee_meng@stripped>
> To: <mysql@stripped>
> Sent: Tuesday, July 08, 2003 10:55 AM
> Subject: "select * from table where field=hex" doesnt work
>
>
> > i inserted a new record with this SQL
> > "INSERT INTO table1(field1) VALUES(0x61006200630064000000)"
> > type of table1.field1 is tinyblob.
> >
> > to retrieve the record, i tried SQL belows,
> > 1) SELECT * FROM table1 WHERE field1 = 0x61006200630064000000;
> > 2) SELECT * FROM table1 WHERE field1 LIKE 0x61006200630064000000;
> > 1st SQL found nothing, but the 2nd SQL found the exact record.
> >
> > Is this a bug? I am using mysql 3.23.41 in Linux.
> >
> >
> > Regards,
> > Koh Swee Meng
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
> >
> >
>
>