Ram*_*ngh 1 mysql sql-server insert temp-tables
select t.*
into #temp
from
(
select 'a' as a
union all
select 'b' as a
) as t
select * from #temp
drop table #temp
Run Code Online (Sandbox Code Playgroud)
我通常在SQL服务器上执行此操作,其中我创建一个临时表.语法"into #temp"在DB上创建非物理表,而"into temp"将在DB上创建物理表.
我在MySQL中的问题是转换上面的MSSQL语句.我想要的是创建一个没有在数据库上物理创建的临时表.我们在MySQL中有这个功能吗?
在MySQL中,您将使用create temporary table as:
create temporary table temp as
select 'a' as a
union all
select 'b' as a ;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4515 次 |
| 最近记录: |