Viewing 15 posts - 766 through 780 (of 11,678 total)
Use window functions:
SELECT USERID, StartDate = MIN(DATES) OVER (PARTITION BY USERID, SET), EndDate = MAX(DATES) OVER (PARTITION BY USERID, SET)
FROM HOLIDAYS;
April 22, 2015 at 7:58 am
alicesql (4/22/2015)
Stewart "Arturius" Campbell (4/22/2015)
alicesql (4/22/2015)
April 22, 2015 at 7:34 am
Nice question, but a bit of a limited explanation.
This article has more info:
April 22, 2015 at 1:31 am
Great question. Not that I use recursive CTEs, but it's good to know π
April 21, 2015 at 3:04 am
Jeff Moden (4/19/2015)
Excellent. And help that young fellow learn how to wear asbestos underwear when everyone is trying to burn him at the stake.
You try to burn him and...
April 21, 2015 at 1:00 am
Grant Fritchey (4/17/2015)
Instead of MAX, try a TOP 1 with an ORDER BY.
Is it such a difference? I would expect that internally a MAX is implemented the same way.
April 17, 2015 at 7:19 am
manub22 (4/17/2015)
But it's NOT a SPAM as still this exam 70-461 is latest and...
April 17, 2015 at 3:33 am
From which tables are col1, col2, col3 and col4? Your sample query is pretty confusing because you didn't use aliases and you didn't put the aliases before the column names.
So...
April 17, 2015 at 1:46 am
manub22 (4/16/2015)
For exam details and on what to prepare for 70-461 Exam check the following blog post:Link:http://sqlwithmanoj.wordpress.com/2012/11/16/passed-70-461-exam-querying-microsoft-sql-server-2012/%5B/url%5D
Because you are promoting your blog post in so many threads, you are pushing...
April 17, 2015 at 1:43 am
Hugo Kornelis (4/15/2015)
RLilj33 (4/15/2015)
April 17, 2015 at 1:36 am
Iwas Bornready (4/15/2015)
Thanks for the question. I didn't realize this even existed.
You are missing out a lot. π
April 17, 2015 at 1:34 am
Viewing 15 posts - 766 through 780 (of 11,678 total)