上述資料中我想要把ACCOUNT1中有文字的資料挑出來因此我用了下面的語法
INSERT INTO `publichistory1`(`TRANSACTIONDATE`, `ACCOUNT1`, `ACCOUNT2`, `AMOUNT`,`DETAIL`) SELECT (`TRANSACTIONDATE`, `ACCOUNT1`, `ACCOUNT2`, `AMOUNT`,`DETAIL`) FROM `publichistory1` WHERE `ACCOUNT1` !=""
但是出現錯誤問題
顯示這串Operand should contain 1 column
想請問一下這應該如何解決
這樣…
INSERT INTO `publichistory1`(`TRANSACTIONDATE`, `ACCOUNT1`, `ACCOUNT2`, `AMOUNT`,`DETAIL`)
SELECT `TRANSACTIONDATE`, `ACCOUNT1`, `ACCOUNT2`, `AMOUNT`,`DETAIL` FROM `publichistory1` WHERE `ACCOUNT1` !=""
因為那是它的語法…
http://www.runoob.com/sql/sql-insert-into-select.html
另外也可以改成
INSERT INTO `publichistory1` SELECT * FROM `publichistory1` WHERE `ACCOUNT1` !=""
感謝你的回答
可以的話就結案吧~