SQL
Comparison of Enums
Enum values are compared according to their order in the enum's definition. For example:  
```sql
CREATE TYPE mood AS ENUM ('sad', 'ok', 'happy');
```  
```sql
SELECT 'sad'::mood < 'ok'::mood AS comp;
```  
| comp |
|-----:|
| true |  
```sql
SELECT unnest(['ok'::mood, 'happy'::mood, 'sad'::mood]) AS m
ORDER BY m;
```  
|   m   |
|-------|
| sad   |
| ok    |
| happy |