我试图从表中获取唯一值,该表将以下内容保存为时间日志文件:
id | time | code | user
1 | 7000 | xxxx | 1
2 | 7000 | xxxx | 1
3 | 7500 | xxxx | 2
4 | 7000 | xxxx | 3
Run Code Online (Sandbox Code Playgroud)
我想知道的是有多少独特用户在时间使用了代码,例如7000,它应该说2但是我写的不同我得到3
SELECT Time, COUNT(*) as total, Code
FROM dbo.AnalyticsPause
WHERE CODE = 'xxxx'
GROUP BY id, Time, Code
Run Code Online (Sandbox Code Playgroud)
结果:
time | Count | code
7000 | 3 | xxxx
7500 | 1 | xxxx
Run Code Online (Sandbox Code Playgroud)
在哪里我想拥有
time | Count | code
7000 | 2 | …Run Code Online (Sandbox Code Playgroud) 我正在开发一个项目,从Phonegap获取指南针脚本,我想将它连接到我当前的GPS位置,而不是指向固定的GPS位置(如餐厅等)基本上箭头必须指向方向餐厅所以我知道哪条路去/步行.
以下是我想要结合的两个:http: //docs.phonegap.com/en/2.0.0/cordova_geolocation_geolocation.md.html#Geolocation http://docs.phonegap.com/en/2.0.0/cordova_compass_compass .md.html#指南针
我把这个项目作为基础:https://github.com/Rockncoder/PGCompass
谁能帮我正确的方向:-)?
Thnx Ewald