0
SELECT
          first_name,
          age,
          gender,
          @curRank := @curRank + 1 AS rank
FROM
          person p, (SELECT @curRank := 0) r
ORDER BY  age;

when am executing this query through hibernate am getting an error

"Space is not allowed after parameter prefix ':'"

how to resolve

1 Answers1

0

If you use := hibernate expects the parameter but you are passing 0.

Option 1 : remove := and use 0 directly

SELECT @curRank = 0

Option 2 : pass value by parameter instead of 0

SELECT @curRank := someparameter

Hope this helps.

Alien
  • 15,141
  • 6
  • 37
  • 57