Reputation: 427
i am trying to replace the message and also decryption of message, i tried the query:
select
aes_decrypt(message,'Password')as message,
replace(message,'#TD1#','\n\n') as message
from
daily
limit 1;
but it is returning 2 columns.
Upvotes: 0
Views: 107
Reputation: 4629
Try This
SELECT REPLACE(AES_DECRYPT(message, 'Password'), '#TD1#', '\n\n') AS message
FROM daily
LIMIT 1;
Upvotes: 1
Reputation: 7242
You have 2 columns in the select, both of them named message also. Try it like this
SELECT REPLACE(AES_DECRYPT(message,'Password'), '#TD1#','\n\n' ) Message
FROM daily
LIMIT 1;
or
SELECT AES_DECRYPT(REPLACE(message, '#TD1#','\n\n' ),'Password') Message
FROM daily
LIMIT 1;
Upvotes: 0