0

表结构:

 create table VOTE_PROPOSER
(
  ID              NUMBER not null,
  NAME            VARCHAR2(100),
  GENDER          VARCHAR2(50),
  BIRTHDAY        DATE,
  IDENTITYTYPE    VARCHAR2(50),
  IDENTITYCODE    VARCHAR2(100),
  PHONENUMBER     VARCHAR2(50),
  CHANNELS        VARCHAR2(50),
  AUTHOR          VARCHAR2(50),
  INSTITUTIONCODE VARCHAR2(50),
  MAILADDRESS     VARCHAR2(200),
  ZIPCODE         VARCHAR2(50),
  IPNO            VARCHAR2(50),
  RETIANVARCHAR4  VARCHAR2(50),
  RETIANVARCHAR5  VARCHAR2(50),
  RETAINDATE1     DATE,
  RETAINDATE2     DATE,
  ISCUSTOMER      NUMBER,
  RETAINNUMBER2   NUMBER,
  RETAINNUMBER3   NUMBER,
  RETAINNUMBER4   NUMBER,
  RETAINNUMBER5   NUMBER,
  SALEMANNAME     VARCHAR2(100),
  SALEMANMOBILE   VARCHAR2(11),
  COUNTRYCODE     VARCHAR2(8),
  PROVINCECODE    VARCHAR2(8)
)

SQL查询:

   SELECT count(*) FROM VOTE_PROPOSER WHERE 1=1 and ID='11111'
4

1 回答 1

0

为什么要ID与字符串进行比较?

Oracle 通常会自动将字符串转换为数字,但如果出现错误,您可以使用:

 SELECT count(*) FROM VOTE_PROPOSER WHERE 1=1 and ID=11111
于 2013-06-04T10:45:22.487 回答