So I have table with cars and color on said cars. Color is shown as an integer, but i want to map it in the select query so that the respective color is shown instead. A mapping table doesn´t exist and I don´t have write access to the database so I can`t create a mapping table. The query is only meant for a dashboard which only allows SQL queries.
I have a table like this:
| **Color** | **Car** |
| 1 | BMW |
| 2 | Nissan |
| 1 | Tesla |
And this query
SELECT "Color", count(*)
FROM "Cars"
GROUP BY "Color"
Which will give this result:
| Color | Count |
| 1 | 2 |
| 2 | 1 |
But what I want is this:
| Color | Count |
| white | 2 |
| green | 1 |
How can i write a query like this?
colorstable that is the reference table with the correct name.