Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 H2 数据库。我尝试了以下SQL,但记录也被复制:
"CREATE TABLE test_tmp AS SELECT * FROM test"
我也试过这个sql:
"CREATE TABLE test_tmp AS SELECT * FROM test WITH NO DATA",
但是我遇到了语法错误异常。那么你知道如何复制没有记录的表吗?
Create table testtmp as select * from test where 1=0
SELECT * INTO test_tmp FROM test WHERE 1=2