Home > Mobile >  How to write 'create table ... as select [some number/function] as test' in MySQL 5.5 so t
How to write 'create table ... as select [some number/function] as test' in MySQL 5.5 so t

Time:07-22

I build the empty frame of a table in MySQL by taking a huge query, adding a WHERE 1 = 0 condition (to shrink down the output rows to 0) and running it like the following tiny example:

create table xzy as 
select convert(2147483647, signed) as test
WHERE 1 = 0

I thought taking the enter image description here

Information about that was found around the middle of the page here.
(their example used a bigint value)

Here's a dbfiddle (using verson 5.5) with example use.

  • Related