I’m running this code:
CREATE TABLE fish (SELECT '5' as size)
So far so good, I get 5 as size.
But then:
UPDATE fish SET size = size *2
should return 10, but it returns 1 instead, thus cutting off the last digit. I assume this is done because sql only saves enought necessary room when tables are created this way. Does anyone know if there is a way to fix this?
Thanks!
If you want that column as integer then why you use Single Quotes…?
just try like below… it will work….