且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

SQL查询中的用户日志数据处理

更新时间:2023-11-21 14:02:46

我会与评论中的人一样有点不同



- 我会写'n'个查询,其中一个查询可能是为用户获取数据x for day y

- 我使用PetaPoco提取数据并返回一个对象列表

- 然后我使用LINQ聚合(可能分组)对象



不幸的是,你必须先启动并为你决定使用的任何方法提供东西,即'纯sql'或基本的sql和LINQ - 这里的人不会为你编写代码
I would do this a 'bit differently' than the guys in the comments

- I'd write 'n' queries, where a query might be to get the data for user x for day y
- I'd use PetaPoco to extract that data and return an object list
- I'd then use LINQ to aggregate (possibly group) the objects

The unfortunate thing is, you have to make a start and supply 'something' for whichever approach you decide to use ie 'pure sql' or basic sql & LINQ - people here wont write your code for you