CREATE TABLE t1(a int) engine=innodb; INSERT INTO t1 VALUES (1); SELECT DISTINCT convert((SELECT des_decrypt(2,1) AS a FROM t1 WHERE @a:=1), signed) as d FROM t1 ; d 2 Warnings: Note 1287 'des_decrypt' is deprecated and will be removed in a future release DROP TABLE t1;