I had a MySQL Table with an ENUM. Since I had to change this ENUM sometimes, I transfered it to another table. Now I have to create a statement, which will give me the name of the enum/newTable in one select field.
Table 1 (bottle):
id | size | size_id
1 | small | (NULL)
2 | medium | (NULL)
3 | big | (NULL)
4 | (NULL) | 1
5 | (NULL) | 2
6 | (NULL) | 3
Table 2 (bottle_size):
id | name
1 | small
2 | medium
3 | big
SELECT:
SELECT id, <dontknow> as size
FROM bottle b
LEFT JOIN bottle_size bz ON b.size_id = bz.id
WHERE size = 'small';
How could I do this?
Thanks
bottle_sizetable? You might want to fix that first, get a level playing field.bottle.sizetext field unused?