I found one solution for this question in mysql but it doesn\'t work with jpa.
select t.* from (select t.*, (@su