取一个字段,无重复值后的个数
VFP 9.0 +SQL
一个字值,有许多重复的值
现想计算出:去掉重复值后的行数.
一时想不出命令来了,请老师帮忙一下.
谢谢
[解决办法]
示例:假设连接SQLSERVER2005
lcConnectString = "Driver={SQL Native Client};Server=tmp;Database=tmp;Uid=sa;Pwd=123;"
nHandle = SQLSTRINGCONNECT(lcConnectString)
sqlexec(nHandle,"SELECT * FROM FF","tt")
SELECT COUNT(distinct f1) as ss FROM tt into curs dd
aa=dd.ss
if aa=2
....