MySql - Create a view with longtext cast into VARCHAR(255)
I am willing to create a view on a table with a longtext column. But I would like that in my view this column be varchar(255). And Yes I would like 开发者_开发技巧to cut the "extra" text.
When I do a substr in the create script the data type is still longtext
Anyone could help me ?
Thanks
How about casting the longtext as a varchar?
CREATE VIEW foo AS
SELECT ID, CAST(MyLongText as char(255)) AS MyVarchar
FROM Table
精彩评论