2014-02-14 56 views
0

我已經使用了相同的查詢,從一個數據庫轉移到另一個時代,但突然我收到錯誤SQL錯誤操作數

「操作數應包含1列(S)」

這裏是我的SQL:

INSERT INTO lightand_expressionengine.exp_channel_data (
    entry_id 
    , site_id 
    , channel_id 
    , field_id_1 
    , field_ft_1 
    , field_id_3 
    , field_ft_3 
    , field_id_7 
    , field_ft_7 
    , field_id_8 
    , field_ft_8 
    , field_id_9 
    , field_ft_9 
    , field_id_11 
    , field_ft_11 
    , field_id_12 
    , field_ft_12 
    , field_id_13 
    , field_ft_13 
    , field_id_14 
    , field_ft_14 
    , field_id_16 
    , field_ft_16 
    , field_id_17 
    , field_ft_17 
    ) 
SELECT (
     entry_id 
     , site_id 
     , channel_id 
     , field_id_1 
     , field_ft_1 
     , field_id_3 
     , field_ft_3 
     , field_id_7 
     , field_ft_7 
     , field_id_8 
     , field_ft_8 
     , field_id_9 
     , field_ft_9 
     , field_id_11 
     , field_ft_11 
     , field_id_12 
     , field_ft_12 
     , field_id_13 
     , field_ft_13 
     , field_id_14 
     , field_ft_14 
     , field_id_16 
     , field_ft_16 
     , field_id_17 
     , field_ft_17 
     ) 
FROM lightand_expressionengineold.exp_channel_data 

任何人都可以看到的問題是什麼?我無法弄清楚。

+0

只是從SELECT子句中刪除括號。 –

回答

2

SELECT中刪除開合支架,即(...)。即嘗試下面的SQL。

INSERT INTO lightand_expressionengine.exp_channel_data (
entry_id 
, site_id 
, channel_id 
, field_id_1 
, field_ft_1 
, field_id_3 
, field_ft_3 
, field_id_7 
, field_ft_7 
, field_id_8 
, field_ft_8 
, field_id_9 
, field_ft_9 
, field_id_11 
, field_ft_11 
, field_id_12 
, field_ft_12 
, field_id_13 
, field_ft_13 
, field_id_14 
, field_ft_14 
, field_id_16 
, field_ft_16 
, field_id_17 
, field_ft_17 
) 
SELECT 
    entry_id 
    , site_id 
    , channel_id 
    , field_id_1 
    , field_ft_1 
    , field_id_3 
    , field_ft_3 
    , field_id_7 
    , field_ft_7 
    , field_id_8 
    , field_ft_8 
    , field_id_9 
    , field_ft_9 
    , field_id_11 
    , field_ft_11 
    , field_id_12 
    , field_ft_12 
    , field_id_13 
    , field_ft_13 
    , field_id_14 
    , field_ft_14 
    , field_id_16 
    , field_ft_16 
    , field_id_17 
    , field_ft_17 
FROM lightand_expressionengineold.exp_channel_data