Viewing 15 posts - 1,711 through 1,725 (of 3,500 total)
Self-joins with aggregates. YUCK.
How about something really simple... maybe like this?
SELECT PatientID
, SessionID
, SessionTime
, LAG([SessionTime]) OVER (PARTITION BY PatientID ORDER BY SessionTime) AS PrevSession
FROM
(SELECT 1 AS PatientID, 1 AS SessionID,...
November 21, 2016 at 6:02 pm
Well, you can't turn columns into rows from that... there's nothing to pivot on.
November 21, 2016 at 3:32 pm
Can you please explain the logic of how to get the result you're looking for? Maybe I'm slow, but that part baffles me. Maybe there's something you understand about the...
November 21, 2016 at 2:56 pm
Are there tables with the data in it somewhere that you could share? From your sample data, it's not entirely clear which columns belong in which logical group (table).
1234...
November 21, 2016 at 12:34 pm
Short answer is that it's a cross join of the first 3 columns (all possible combinations) and then outer join back to the original table to pick up the nulls...
November 21, 2016 at 9:47 am
Either you have something wrong in your data or T2 is irrelevant to the question.
Here's my solution with the sample data included. Note that the second table you provide is...
November 19, 2016 at 4:57 pm
Your question forced me to look up the definition of the grain of a table... good thing to do.
Identifying the level of detail
The level of detail that is available in...
November 18, 2016 at 5:16 pm
Can't vouch for any of this, but here's a discussion very similar to what you're trying to do.
November 18, 2016 at 12:28 am
I think I understand what's up with this... D3 apparently consumes JSON data. check out Mike Bostock's site... If you look at the bottom of the page,...
November 18, 2016 at 12:19 am
Is there any kind of consistency in the Excel files? Do the contents of Sheet1 always go to a specific table? If the sheet sequence and column sequences are consisent,...
November 17, 2016 at 11:55 pm
Viewing 15 posts - 1,711 through 1,725 (of 3,500 total)