有没有办法基于现有表(select)创建新表而不用现有数据填充新表?
示例,此查询填充新表:
CREATE TABLE tempTable NO PARTITION AS
( SELECT
TRIM(COMPANY_ID) AS COMPANY_ID
FROM
{schema}.table2
FOR READ UNCOMMITTED ACCESS IN SHARE MODE );
感谢。
答案 0 :(得分:1)
在SQL Server中,您可以执行
SELECT *
INTO NewTable
FROM OldTable
WHERE 1 = 0