#257 Functions in SELECT clause

v3.2
open
nobody
JBossCMP (36)
5
2003-08-24
2003-08-24
No

The following queries are the examples of the feature:

SELECT COUNT(b.id) FROM B AS b
SELECT SQRT(b.longField) FROM B AS b WHERE b.id = ?1
SELECT ABS(b.longField) FROM B AS b WHERE b.id = ?1
SELECT LCASE(b.name) FROM B AS b WHERE b.id = ?1
SELECT UCASE(b.name) FROM B AS b
SELECT LENGTH(b.name) FROM B AS b WHERE b.id = ?1
SELECT CONCAT('Dear ', b.name) FROM B AS b WHERE b.id = ?1
SELECT LOCATE('ice', b.name, 1) FROM B AS b WHERE b.id = ?1
SELECT SUBSTRING(b.name, 3, 5) FROM B AS b WHERE b.id = ?1
SELECT UCASE(SUBSTRING(CONCAT(b.id, b.name), 5, 7))
FROM B AS b WHERE b.id = ?1

If the result of a function is an integer value, the
result will be of type java.lang.Long. If the result is
real, then java.lang.Double is returned.

Discussion


Log in to post a comment.