When I run attached example, it creates table with column id and data type bigint(295)
I would like to define it as int(11).
In more complex query (I’ve got ids from group concat) I’ve got text instead of int.
How to specify data type on create table as select in mysql?
DROP TABLE IF EXISTS some_table;
CREATE TABLE IF NOT EXISTS some_table AS (
SELECT
CONVERT("123,456,789,987,654,321,741,852,963,147,258,369,123,456,789,987,654,321,741,852,963,147,258,369
,2123,456,789,987,654,321,741,852,963,147,258,369,123,456,789,987,654,321,741,852,963,147,258,369
,3123,456,789,987,654,321,741,852,963,147,258,369,123,456,789,987,654,321,741,852,963,147,258,369"
, SIGNED INTEGER) AS id);
I can’t find straight way to do it.
Solve it by alter table, worked me, perhaps there is better solution.