# CAST
## Definition(s)
### Context
#### Sub-context: [[SQL keywords]]
>[! Definition]
>A SQL function that converts data from one datatype to another
## Examples
```SQL
SELECT CAST(var_name AS FLOAT) AS new_var_name
FROM db.tb
ORDER BY new_var_name DESC;
```
## Related
[[SQL]]
## Resources
## Flashcards
The below code are generated for use with [Spaced Repetition plugin](https://github.com/st3v3nmw/obsidian-spaced-repetition/) [docs](https://www.stephenmwangi.com/obsidian-spaced-repetition/)
A SQL function that converts data from one datatype to another @@@ [[CAST]]