mysql 二进制操作示例代码
首先问题来源于这里:
http://stackoverflow.com/questions/2032239/binary-data-in-mysql/13511985#13511985
可能并没有完全解决问题,但至少是个解决方案
mysql表字段设置为int 或者bigint,那么这个字段至少有31位/63位可以用来表示不同的需求
下面是回复内容
Hope, this code can help you:
for select:
select conv(column_name, from_base, to_base) from table_name //example: select conv(column1, 10, 2) from table1;
for insert:
insert into table_name(column1) values( B'binary_data') ; //example : insert into table1(column1) values( B'1110000');
for query:
select column1,column2 from table_name where column1 & B('binary_data'); //example: select column1, column2 from table1 where column1 & B('1110000');
相关推荐
emmm00 2020-11-17
yishouwangnian 2020-08-18
温攀峰 2020-08-17
jiangtie 2020-08-15
stulen 2020-08-15
herohope 2020-07-19
FORYAOSHUYUN 2020-07-08
xiaojiang0 2020-06-21
Erick 2020-06-17
hickwu 2020-06-16
小秋 2020-06-15
spinachcqb 2020-06-13
TMD咯MySQL 2020-06-11
88427810 2020-06-10
pengpengflyjhp 2020-06-08
hevenue 2020-06-08
徐建岗网络管理 2020-06-07