使用to_base64和from_base64加密解密,如何进行模糊查询。要求mysql和达梦数据库都兼容。这是sql语句,在mysql可以查询到数据,但是达梦数据库中查询不到。应该是from_base64 函数类型是varbinary,mysql支持,达梦不支持直接like。
SELECT * FROM system_users WHERE from_base64(mobile) like '%19989090111%'
回答 0
暂无回答
哄哄
做一下类型转换试试:
drop table if exists test;
create table test(c1 int, c2 varchar);
insert into test values(1, to_base64('199890901110')); commit;
SELECT * FROM test WHERE BINTOCHAR(from_base64(c2)) like '%19989090111%'
做一下类型转换试试:
drop table if exists test;
create table test(c1 int, c2 varchar);
insert into test values(1, to_base64('199890901110')); commit;
SELECT * FROM test WHERE BINTOCHAR(from_base64(c2)) like '%19989090111%'