What's in the mind of the SO poster?
I love the bridge I'm gonna make! This is a SO post.
There are not any technicalities involved, you can ignore the code of the declare table insert ..... stuff, and just focus on the dates the OP has, and the ones they need.
I though, "who can guess this obscure fact"? And the answer was "Only the crazy geniuses at puzzling!!!"
Can anyone figure the request out?
logical-deduction
add a comment |
I love the bridge I'm gonna make! This is a SO post.
There are not any technicalities involved, you can ignore the code of the declare table insert ..... stuff, and just focus on the dates the OP has, and the ones they need.
I though, "who can guess this obscure fact"? And the answer was "Only the crazy geniuses at puzzling!!!"
Can anyone figure the request out?
logical-deduction
1
... the OP has, and the ones 'they need' ? or he needs?
– Jannis
Dec 4 at 16:14
I know the accepted answer has more detail, but it appears that the first poster was just as correct with determining the request...?
– El-Guest
Dec 4 at 16:44
@El-Guest That's true!
– Pablo Lozano
Dec 4 at 16:51
add a comment |
I love the bridge I'm gonna make! This is a SO post.
There are not any technicalities involved, you can ignore the code of the declare table insert ..... stuff, and just focus on the dates the OP has, and the ones they need.
I though, "who can guess this obscure fact"? And the answer was "Only the crazy geniuses at puzzling!!!"
Can anyone figure the request out?
logical-deduction
I love the bridge I'm gonna make! This is a SO post.
There are not any technicalities involved, you can ignore the code of the declare table insert ..... stuff, and just focus on the dates the OP has, and the ones they need.
I though, "who can guess this obscure fact"? And the answer was "Only the crazy geniuses at puzzling!!!"
Can anyone figure the request out?
logical-deduction
logical-deduction
asked Dec 4 at 15:58
George Menoutis
920211
920211
1
... the OP has, and the ones 'they need' ? or he needs?
– Jannis
Dec 4 at 16:14
I know the accepted answer has more detail, but it appears that the first poster was just as correct with determining the request...?
– El-Guest
Dec 4 at 16:44
@El-Guest That's true!
– Pablo Lozano
Dec 4 at 16:51
add a comment |
1
... the OP has, and the ones 'they need' ? or he needs?
– Jannis
Dec 4 at 16:14
I know the accepted answer has more detail, but it appears that the first poster was just as correct with determining the request...?
– El-Guest
Dec 4 at 16:44
@El-Guest That's true!
– Pablo Lozano
Dec 4 at 16:51
1
1
... the OP has, and the ones 'they need' ? or he needs?
– Jannis
Dec 4 at 16:14
... the OP has, and the ones 'they need' ? or he needs?
– Jannis
Dec 4 at 16:14
I know the accepted answer has more detail, but it appears that the first poster was just as correct with determining the request...?
– El-Guest
Dec 4 at 16:44
I know the accepted answer has more detail, but it appears that the first poster was just as correct with determining the request...?
– El-Guest
Dec 4 at 16:44
@El-Guest That's true!
– Pablo Lozano
Dec 4 at 16:51
@El-Guest That's true!
– Pablo Lozano
Dec 4 at 16:51
add a comment |
2 Answers
2
active
oldest
votes
Sample data
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
Need output like this . Can anyone suggest me best way to do it
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-10-27 04:28:16.000 2018-11-17 17:15:36.000
2018-10-05 03:31:51.000 2018-10-22 16:10:53.000
It seems OP wants to
group overlapping events.
start end
A 2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
B 2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
C 2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
D 2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
E 2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
F 2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
It you order it chronologically, row F is the first event.
Row E starts at the same time, but ends after, so
we group these two rows:(F) 2018-10-05 03:31:51.000 (E) 2018-10-21 02:12:58.000
Then D starts before E finishes,
so we group again (F) 2018-10-05 03:31:51.000 (D) 2018-10-22 16:10:53.000
Row C event starts after D is finished
but it is overlapped with B (C) 2018-10-27 04:28:16.000 (B) 2018-11-17 17:15:36.000
And finally,
Event in row A does not overlap any other event
I love this place, congratulations!
– George Menoutis
Dec 4 at 16:41
Wow, my first answer!
– Pablo Lozano
Dec 4 at 16:43
Great answer, @PabloLozano!!
– El-Guest
Dec 4 at 18:17
add a comment |
The request seems to be: there is a table containing pairs of dates, each describing a time interval. The OP is looking for a query combining overlapping intervals, that would give him the minimal set of time intervals exactly covering the time periods that the initial table was covering.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
return StackExchange.using("mathjaxEditing", function () {
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
});
});
}, "mathjax-editing");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "559"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
noCode: true, onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f76057%2fwhats-in-the-mind-of-the-so-poster%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sample data
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
Need output like this . Can anyone suggest me best way to do it
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-10-27 04:28:16.000 2018-11-17 17:15:36.000
2018-10-05 03:31:51.000 2018-10-22 16:10:53.000
It seems OP wants to
group overlapping events.
start end
A 2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
B 2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
C 2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
D 2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
E 2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
F 2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
It you order it chronologically, row F is the first event.
Row E starts at the same time, but ends after, so
we group these two rows:(F) 2018-10-05 03:31:51.000 (E) 2018-10-21 02:12:58.000
Then D starts before E finishes,
so we group again (F) 2018-10-05 03:31:51.000 (D) 2018-10-22 16:10:53.000
Row C event starts after D is finished
but it is overlapped with B (C) 2018-10-27 04:28:16.000 (B) 2018-11-17 17:15:36.000
And finally,
Event in row A does not overlap any other event
I love this place, congratulations!
– George Menoutis
Dec 4 at 16:41
Wow, my first answer!
– Pablo Lozano
Dec 4 at 16:43
Great answer, @PabloLozano!!
– El-Guest
Dec 4 at 18:17
add a comment |
Sample data
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
Need output like this . Can anyone suggest me best way to do it
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-10-27 04:28:16.000 2018-11-17 17:15:36.000
2018-10-05 03:31:51.000 2018-10-22 16:10:53.000
It seems OP wants to
group overlapping events.
start end
A 2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
B 2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
C 2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
D 2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
E 2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
F 2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
It you order it chronologically, row F is the first event.
Row E starts at the same time, but ends after, so
we group these two rows:(F) 2018-10-05 03:31:51.000 (E) 2018-10-21 02:12:58.000
Then D starts before E finishes,
so we group again (F) 2018-10-05 03:31:51.000 (D) 2018-10-22 16:10:53.000
Row C event starts after D is finished
but it is overlapped with B (C) 2018-10-27 04:28:16.000 (B) 2018-11-17 17:15:36.000
And finally,
Event in row A does not overlap any other event
I love this place, congratulations!
– George Menoutis
Dec 4 at 16:41
Wow, my first answer!
– Pablo Lozano
Dec 4 at 16:43
Great answer, @PabloLozano!!
– El-Guest
Dec 4 at 18:17
add a comment |
Sample data
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
Need output like this . Can anyone suggest me best way to do it
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-10-27 04:28:16.000 2018-11-17 17:15:36.000
2018-10-05 03:31:51.000 2018-10-22 16:10:53.000
It seems OP wants to
group overlapping events.
start end
A 2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
B 2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
C 2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
D 2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
E 2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
F 2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
It you order it chronologically, row F is the first event.
Row E starts at the same time, but ends after, so
we group these two rows:(F) 2018-10-05 03:31:51.000 (E) 2018-10-21 02:12:58.000
Then D starts before E finishes,
so we group again (F) 2018-10-05 03:31:51.000 (D) 2018-10-22 16:10:53.000
Row C event starts after D is finished
but it is overlapped with B (C) 2018-10-27 04:28:16.000 (B) 2018-11-17 17:15:36.000
And finally,
Event in row A does not overlap any other event
Sample data
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
Need output like this . Can anyone suggest me best way to do it
start_udt end_udt
2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
2018-10-27 04:28:16.000 2018-11-17 17:15:36.000
2018-10-05 03:31:51.000 2018-10-22 16:10:53.000
It seems OP wants to
group overlapping events.
start end
A 2018-11-21 10:25:00.000 2018-11-27 17:15:18.000
B 2018-11-15 07:48:00.000 2018-11-17 17:15:36.000
C 2018-10-27 04:28:16.000 2018-11-16 12:34:30.000
D 2018-10-18 03:34:44.000 2018-10-22 16:10:53.000
E 2018-10-05 03:31:51.000 2018-10-21 02:12:58.000
F 2018-10-05 03:31:51.000 2018-10-20 22:20:33.000
It you order it chronologically, row F is the first event.
Row E starts at the same time, but ends after, so
we group these two rows:(F) 2018-10-05 03:31:51.000 (E) 2018-10-21 02:12:58.000
Then D starts before E finishes,
so we group again (F) 2018-10-05 03:31:51.000 (D) 2018-10-22 16:10:53.000
Row C event starts after D is finished
but it is overlapped with B (C) 2018-10-27 04:28:16.000 (B) 2018-11-17 17:15:36.000
And finally,
Event in row A does not overlap any other event
answered Dec 4 at 16:31
Pablo Lozano
2063
2063
I love this place, congratulations!
– George Menoutis
Dec 4 at 16:41
Wow, my first answer!
– Pablo Lozano
Dec 4 at 16:43
Great answer, @PabloLozano!!
– El-Guest
Dec 4 at 18:17
add a comment |
I love this place, congratulations!
– George Menoutis
Dec 4 at 16:41
Wow, my first answer!
– Pablo Lozano
Dec 4 at 16:43
Great answer, @PabloLozano!!
– El-Guest
Dec 4 at 18:17
I love this place, congratulations!
– George Menoutis
Dec 4 at 16:41
I love this place, congratulations!
– George Menoutis
Dec 4 at 16:41
Wow, my first answer!
– Pablo Lozano
Dec 4 at 16:43
Wow, my first answer!
– Pablo Lozano
Dec 4 at 16:43
Great answer, @PabloLozano!!
– El-Guest
Dec 4 at 18:17
Great answer, @PabloLozano!!
– El-Guest
Dec 4 at 18:17
add a comment |
The request seems to be: there is a table containing pairs of dates, each describing a time interval. The OP is looking for a query combining overlapping intervals, that would give him the minimal set of time intervals exactly covering the time periods that the initial table was covering.
add a comment |
The request seems to be: there is a table containing pairs of dates, each describing a time interval. The OP is looking for a query combining overlapping intervals, that would give him the minimal set of time intervals exactly covering the time periods that the initial table was covering.
add a comment |
The request seems to be: there is a table containing pairs of dates, each describing a time interval. The OP is looking for a query combining overlapping intervals, that would give him the minimal set of time intervals exactly covering the time periods that the initial table was covering.
The request seems to be: there is a table containing pairs of dates, each describing a time interval. The OP is looking for a query combining overlapping intervals, that would give him the minimal set of time intervals exactly covering the time periods that the initial table was covering.
answered Dec 4 at 16:30
Laurent LA RIZZA
1415
1415
add a comment |
add a comment |
Thanks for contributing an answer to Puzzling Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fpuzzling.stackexchange.com%2fquestions%2f76057%2fwhats-in-the-mind-of-the-so-poster%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
... the OP has, and the ones 'they need' ? or he needs?
– Jannis
Dec 4 at 16:14
I know the accepted answer has more detail, but it appears that the first poster was just as correct with determining the request...?
– El-Guest
Dec 4 at 16:44
@El-Guest That's true!
– Pablo Lozano
Dec 4 at 16:51