Reputation: 2703
I want to convert count to Letter in Oracle.Currently I am using below query.
SELECT DECODE ((SELECT COUNT(*)FROM MyTable), 0, 'A',
1, 'B',
2, 'C',
3, 'D',
4, 'E',
5, 'F',
6, 'G',
7, 'H')
FROM DUAL;
Is there any particular oracle function which converts digit to letter.
Upvotes: 3
Views: 115
Reputation: 25013
My syntax may be wrong, but the CHR function is what you're after...
SELECT CHR(65 + COUNT(*)) FROM MyTable
...assuming you are using a character set in which "A" has a code of 65 and the letters are sequential after that.
Upvotes: 5