如下:
我有一张读者表reader,字段有:id,certify(身份证),name(姓名) 
通过一个表单输入用户名和密码进行验证,密码是certify(身份证)后6位
请问这样的SQl怎么实现。
如select count(*) from reader where 密码后六位验证,怎么写呢?谢谢各位高人了。在线等着交功课。

解决方案 »

  1.   

    select count(1) from reader where substr(certify,1,6)=页面上的值
      

  2.   

    substr(certify,1,6) 是certify的前6位
    密码是certify(身份证)后6位
    那后6位呢?
      

  3.   

    select count(1) from reader where substr(certify,1,-1,6)=页面上的值
      

  4.   

    with a as
    (select '11213412341341310' a01 from dual
    )
    select substr(a01,1,6),substr(a01,length(a01)-5,6) from a
      

  5.   

    select count(1) from reader where substr(certify,-6,6)谢谢各位