where子句错误的未知列

时间:2014-07-15 09:38:49

标签: mysql

以下是数据库中的代码类型。

CREATE TABLE customerlist
    (
      C_Id INT auto_increment,
      LoginID VARCHAR(10),
      Password VARCHAR(20) ,
      Name VARCHAR(20),
      Phone VARCHAR(15),
      IDCARDNO VARCHAR(15),
      Email VARCHAR(30),
      BankACNO VARCHAR(18),
      Plan VARCHAR(4),
      Date VARCHAR,
      PRIMARY KEY (C_Id),
      UNIQUE (LoginID)
    );

    insert into customerlist  values( 'A1','123','peter','123456','88888','abc@yahoo.com','1231','three','2014-01-12');

但是当我输入select * from customerlist where LoginID = A1;时 它有错误:Unknown column 'A1' in 'where clause'

如何清楚地解决?谢谢

1 个答案:

答案 0 :(得分:2)

如果您想将字段与其值进行比较,请按照下面给出的fieldName = "value"进行比较。

SELECT * FROM customerlist WHERE LoginID = "A1";