TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
ezequiel campos
NA
3
2.1k
OVER SqlFunction with LINQ
Aug 23 2012 7:14 AM
I have a list of items and I need to list it by the intervals.
This is the data:
number
1
2
3
9
10
15
18
19
20
21
I have this query:
SELECT MIN(number) AS range_start,
MAX(number) AS range_end,
COUNT(number)
FROM (
SELECT number,
number - ROW_NUMBER() OVER(ORDER BY number) AS grp
FROM Table AS A
) AS T
GROUP BY grp;
which results this:
range_start | range_end | count
1 3 3
9 10 2
15 15 1
18 21 4
How can I do that with LINQ?
Reply
Answers (
1
)
How can I rewrite this LINQ to Entities query without getting the Parameterless Constructors error
linq to sql obtain primary keey value