Multiple Selects With One Column Encrypted I am trying to do two select statements on the same table. However I get errors. The reason for this query is one of the columns is 256 bit CRC encrypted. Here is my query:

SELECT (select COLUMNA from TABLE) AS 'NumberA',
(select CAST(aes_decrypt(COLUMNB,'key','IV') AS CHAR) from TABLE) AS 'Number2';


This query throws this error:

Error Code: 1242. Subquery returns more than 1 row


Both of these selects by themselves work fine. However I need to figure out how to select all of the columns and use the encrypted column in the query as well.

Also, if you can't answer the question, don't put it on hold. Just state you don't know the answer
I don't believe the issue is concerning the encryption. You are doing two sub-queries either of which could contain multiple rows, hence the error. If both source tables are the same, you can re-write as: -

SELECT COLUMNA AS 'NumberA',
CAST(aes_decrypt(COLUMNB,'key','IV') AS CHAR) AS 'Number2'
FROM TABLE