我在delphi中编写的代码查询数据库中的表select count(distinct(code)) from book,运行时提示distinct没有定义,请问如何在delphi中定义distinct函数?

解决方案 »

  1.   

    算了,不结贴也就当施舍了。这个不是delphi的问题,而是你的数据库不认你这句话。
    把你的sql语句放到数据库里面执行一下,调试成功以后再放到Delphi里面吧
      

  2.   

    select count(*) from ( select ditinct code from book)
      

  3.   

    select count(*) from ( select distinct code from book)
      

  4.   

    sql语句问题,跟delphi没有关系
    select count(distinct(code)) from book
    更改为
    select count(distinct code) from book
      

  5.   

    我的sql server 怎么能用 select count(distinct(code)) from book
      

  6.   

    用TQuery控件是不认识distinct这个函数的改用ADOQuery就行了