SQL 查询在创建临时文件时遇到问题 table

SQL Query having trouble creating temporary table

我正在尝试使用我的 table adult3 创建一个临时 table,其中包含列 class 中对应于条件的行:

SELECT class INTO #CLTable
FROM adult3
WHERE (class = '<=50K');

但我一直收到错误消息:

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
'FROM adult3
WHERE (class = '<=50K')' at line 2

我不明白我做错了什么。

我相信您正在使用 SQL 服务器语法来创建临时文件 table。

试试这个:

create temporary table CLTable as 
select class from adult3
where (class='<=50K');

你可以试试:

    INSERT INTO [tempTableName]
    SELECT class FROM adult3
    WHERE (class='<=50k')