2014-07-18 41 views
-2
select * from chbookmaster where acno='011000001401' 



30 011000001401 2 2381 2390 TEST shiva 20140718 10 N (null) Y (null) (null) (null) 



delete from chbookmaster where acno = 011000001401 

    1:18:13 [DELETE - 0 row(s), 0.000 secs] 
    [Error Code: 1054, SQL State: 42S22] 
    Unknown column 'ACNO' in 'where clause' 
    Code: 1054 SQL State: 42S22 --- Unknown column 'ACNO' in 'where clause' 
... 1 statement(s) executed, 0 row(s) affected, 
exec/fetch time: 0.000/0.000 sec [0 successful, 0 warnings, 1 errors] 
CREATE TABLE chbookmaster 
    (
     TxnId bigint NOT NULL AUTO_INCREMENT, 
     ACNo VARCHAR(12) NOT NULL, 
     ChBookNo VARCHAR(8) NOT NULL, 
     ChNoFrom INT NOT NULL, 
     ChNoTo INT NOT NULL, 
     Remarks VARCHAR(250), 
     IssuedBy VARCHAR(20) NOT NULL, 
     IssueDt VARCHAR(8), 
     leafs INT DEFAULT '0' NOT NULL, 
     Auth VARCHAR(1) NOT NULL, 
     AuthBy VARCHAR(20), 
     chargeflag VARCHAR(1) NOT NULL, 
     LastUpdateBy VARCHAR(20), 
     LastUpdateDt DATETIME, 
     sno DOUBLE, 
     PRIMARY KEY (TxnId) 
    ) 
    ENGINE=InnoDB DEFAULT CHARSET=latin1; 
+1

嘗試在你的select語句的值附近添加引號。 – Jens

+0

@Jens爲什麼會導致上面的具體錯誤? –

+1

請添加您的表的創建語句。 – Jens

回答

0

chbookmaster被聲明爲varchar。你應該用單引號括起這個值。

delete from chbookmaster where acno = '011000001401'; 
+0

我已經試過這個,但同樣的問題正在發生。 –