Mysql AES_DECRYPT()和Replace函数在一起?

时间:2013-10-28 06:48:58

标签: mysql

我正在尝试替换消息并解密消息, 我尝试了查询:

select 
   aes_decrypt(message,'Password')as message,
   replace(message,'#TD1#','\n\n') as message   
from 
  daily 
limit 1;

但它返回2列。

2 个答案:

答案 0 :(得分:1)

试试这个

SELECT REPLACE(AES_DECRYPT(message, 'Password'), '#TD1#', '\n\n') AS message 
FROM   daily 
LIMIT  1; 

答案 1 :(得分:0)

select中有2列,它们也都是message。试试这个

 SELECT REPLACE(AES_DECRYPT(message,'Password'), '#TD1#','\n\n' ) Message
 FROM daily 
 LIMIT 1;

 SELECT AES_DECRYPT(REPLACE(message, '#TD1#','\n\n' ),'Password') Message
 FROM daily 
 LIMIT 1;