There are no restrictions on how you use columns with the decrypt default attribute in a query. You can use them in a target list expression, order by, group by, or subquery. Although expressions on the decrypt default constant value may not have a practical use, placing a decrypt default on a column does not impose any restrictions on use of the column in a Transact-SQL statement.
This example uses an expression on a column with a decrypt default value in the target list:
create table emp_benefits (col1 name char(30), salary float encrypt decrypt_default -99.99)
If you perform a select against this table, but do not have decrypt permission, you see:
select salary/12 as monthly_salary from emp_benefits where name = 'Bill Smith'
monthly_salary --------------------- 8.332500
When Adaptive Server returns a column’s decrypt default value on a select into command, this decrypt default value is inserted into the target table. However the target column does not inherit the decrypt default property. You must use alter table to specify a decrypt default on the target table.