SQL Generate random letters

Date: 2021-09-30
SELECT 
CHR(CAST(65 + FLOOR(RAND() * 3) AS INTEGER)) AS LETTERS
FROM table(VALUES 1, 2, 3, 4)

-- result:
====================
| LETTERS: CHAR(1) |
====================
| A                |
| B                |
| A                |
| C                |
====================

-- Usable in update statement:
UPDATE MyTable SET MyColumn = CHR(CAST(65 + FLOOR(RAND() * 3) AS INTEGER))

54160cookie-checkSQL Generate random letters