Viewing 15 posts - 1,546 through 1,560 (of 2,007 total)
;WITH CTE AS (
SELECT patient_id, attendance_date,
ROW_NUMBER() OVER (PARTITION BY patient_id ORDER BY attendance_date DESC) AS rn
FROM PS_TestForOnline)
SELECT a.patient_id, a.attendance_date, b.attendance_date
FROM CTE a
LEFT OUTER JOIN CTE b ON a.patient_id = b.patient_id...
September 9, 2011 at 4:28 am
I've written the query to represent how I think you've explained your task rather than your expected result-set that you provided.
;WITH CTE AS (
SELECT patient_id, attendance_date,
ROW_NUMBER() OVER (PARTITION BY patient_id...
September 9, 2011 at 4:16 am
"Warning: Null value is eliminated by an aggregate or other SET operation"
This is probably caused by having ANSI_WARNINGS on and an aggregate on a column which contains a null value.
e.g.
SET...
September 8, 2011 at 9:34 am
This is a presentation layer task and should be dealt with there.
However, you can do it in t-sql like this: -
DECLARE @values AS TABLE (value INT)
INSERT INTO @values
SELECT 11000
UNION ALL...
September 8, 2011 at 3:33 am
Ninja's_RGR'us (9/6/2011)
Cadavre (9/6/2011)
September 6, 2011 at 10:12 am
There's not way to turn off the transaction log, but if you're using the batching idea that I proposed above then you could try setting to SIMPLE recovery mode so...
September 6, 2011 at 10:08 am
Pagan DBA (9/6/2011)
Besides the point at this time, don't you think? The deprecation of the "syntax" has nothing to do with my...
September 6, 2011 at 9:50 am
Ninja's_RGR'us (9/6/2011)
Cadavre (9/6/2011)
Timestamp datatype is deprecated.Agreed but this is 2k5 and I don't see how it would solve the issue at hand ;-).
It doesn't, just a warning that it's likely...
September 6, 2011 at 8:58 am
September 6, 2011 at 8:50 am
Best bet is probably to use a CLR, but you could use the ASCII function.
e.g.
DECLARE @input VARCHAR(100), @output VARCHAR(100)
SET @input = 'HTH123³Def'
--Tally table would be better, for testing purposes I've...
September 6, 2011 at 5:02 am
How's this?
SELECT b.*
FROM (SELECT question
FROM answers
GROUP BY question
HAVING COUNT(question) > 1)...
September 1, 2011 at 3:05 am
Nice one Chris 😉
Told you someone would simplify it Greg
August 31, 2011 at 9:34 am
Hmmm, not sure that I understand correctly.
(Sorry if I'm a bit slow replying, got a lovely issue that I'm solving at work)
Currently, the code I've supplied would show the following...
August 31, 2011 at 9:26 am
Could you show me the expected output?
August 31, 2011 at 8:46 am
drew.georgopulos (8/29/2011)
i found the answer by construction;
I graphed the original data in Excel
I added...
August 31, 2011 at 7:30 am
Viewing 15 posts - 1,546 through 1,560 (of 2,007 total)