Viewing 15 posts - 1,696 through 1,710 (of 3,482 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
If you have any say in the structure of the database, stay away from a design where you have dates/information for column names. Been there, done that. It was an...
November 17, 2016 at 9:52 pm
Sounds like homework. So I'm not going to give you a direct answer, because then you wouldn't learn anything. And this forum isn't an answer machine...
If you're...
November 17, 2016 at 9:42 pm
Did this ever work in Access? If so, I would look at the RowSource properties of the various forms involved, so you know what's coming from where. Once you...
November 16, 2016 at 11:02 am
Viewing 15 posts - 1,696 through 1,710 (of 3,482 total)