I have a working SQL query.
But I am unable to convert the same into HQL
SELECT * FROM Customer e where RIGHT(e.mobile,10)='999999999';
How to write this into HQL ?
I have a working SQL query.
But I am unable to convert the same into HQL
SELECT * FROM Customer e where RIGHT(e.mobile,10)='999999999';
How to write this into HQL ?
RIGHT(str, len)
is the same thing as SUBSTRING(str, LENGTH(str) - len + 1)
HQL supports LIKE
, so you can express this as:
SELECT *
FROM Customer e
WHERE e.mobile LIKE '%999999999';
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!