seclare @cnt int
SELECT @cnt=COUNT(*)  FROM table1 where c_filed like '中国'

解决方案 »

  1.   

    sqlexec(lnHandle,"SELECT COUNT(*)  AS TOTALNUM FROM table1 where c_filed like '中国'","Temp")不是更加简单?
        这样的话,结果是一临时表temp,难道就不能在server中将记录数直接赋给一个变量吗?
      

  2.   

    declare @a int
    SELECT @a=COUNT(*)  FROM table1 where c_filed like '中国'
    select @a
      

  3.   


    DECLARE @num int
    SELECT @num =COUNT(*)  FROM table1 where c_filed like '中国'
    SELECT @num 
      

  4.   

    seclare @cnt int
    SELECT @cnt=COUNT(*)  FROM table1 where c_filed like '中国'
    风云老师说的对。
      

  5.   

    seclare @cnt int
    SELECT @cnt=COUNT(*)  FROM table1 where c_filed like '中国'怎么返回到vfp就不知道了,建议你到vfp版问一下.