On Wed, May 10, 2017 at 06:54:49PM +0000, David Villasmil wrote:
I don't think I can... there's no cast to
smallint :(
Indeed, but take a look at this workaround with a custom function
returning a smallint:
http://ask.brothersoft.com/how-to-convert-from-int-to-smallint-86641.html
(which contains an obviuos error). But using the custom function in a
view works:
create view testSI as select convToSmallInt(anint) from testT;
select * from testSI;
+-----------------------+
| convToSmallInt(anint) |
+-----------------------+
| 123 |
| 432 |
| 5344 |
| 32767 |
+-----------------------+
4 rows in set, 1 warning (0.00 sec)