Viewing 15 posts - 436 through 450 (of 3,543 total)
Luis Cazares (5/25/2016)
ThomasRushton (5/25/2016)
Ed Wagner (5/25/2016)
Manic Star (5/25/2016)
Hugo Kornelis (5/25/2016)
Grumpy DBA (5/25/2016)
ThomasRushton (5/25/2016)
painJoy and
Heaven and
Chocolate Sprinkles
Ice Cream
Cake!
Birthday
Antediluvian
May 25, 2016 at 10:16 am
WITH a (PID,VisitType,Rn,RowNo)
AS (
SELECT PID,VisitType,Rn
,ROW_NUMBER() OVER (PARTITION BY PID,Rn ORDER BY VisitType ASC)
FROM @PatDev
),
b (PID,MaxRowNo)
AS (
SELECT PID,MAX(RowNo)
FROM a
GROUP BY PID
)
SELECT b.PID
,MAX(CASE WHEN c.C = 1 THEN ISNULL(a2.VisitType,a.VisitType) END) AS [Col1]
,MAX(CASE...
May 25, 2016 at 7:16 am
TheSQLGuru (5/20/2016)
....suffer from concurrency flaws....
Nice catch Kevin 🙂
May 20, 2016 at 6:07 am
DECLARE @InvoiceNo int = ISNULL((SELECT MAX(o.InvoiceNo) FROM Orders o),0);
WITH cte (ID,InvoiceNo)
AS (
SELECTo.ID,@InvoiceNo+ROW_NUMBER() OVER (ORDER BY o.ID ASC)
FROMOrders o
JOIN SetupAccountTypes a
ON a.ID = o.AccountTypeID
AND a.AccountType = 'COD'
AND o.DeliveryDate >= '20160101'
AND o.DeliveryDate...
May 20, 2016 at 5:54 am
First you need to allocate a unique number to each row
Second use Jeff Moden's DelimitedSplit8K function (here) to split the data
Third use PIVOT or CASE statements to pivot...
May 20, 2016 at 5:32 am
Lowell (5/16/2016)
I just got my MCSA after taking 70-463 Implementing a Data Warehouse in SQL Server 2012/2014.
I had set a mental...
May 16, 2016 at 9:47 am
Create a new report, add data source and dataset
Drag all four columns (ID Seller Hyderabad Bangalore) to detail box
continue on to finish report
Double click on Details_Group under Row Groups
Click Add...
May 11, 2016 at 6:37 am
KMM-489657 (11/15/2007)
May 11, 2016 at 6:03 am
WayneS (5/6/2016)
33 years... wow. I sure hope that you have been quite happy with them.
Well there have been ups and downs but I weathered the storms and even survived some...
May 7, 2016 at 1:17 am
Grumpy DBA (5/4/2016)
May 6, 2016 at 2:16 am
Glad I got a channel now to watch it, missed it for ages.
Watched a replay of the 5 hour marathon of the Red Sox / Astros game.
Thrilling game could not...
April 26, 2016 at 1:57 am
Ed Wagner (4/25/2016)
April 25, 2016 at 5:22 am
Jeff Moden (4/24/2016)
My favorite of all time, though, is "If he had 2 brains, he'd be twice as stupid". 😀
Hey, I resemble that remark :crazy:
April 25, 2016 at 5:20 am
Add another column to signify row type or ordering and union all to join the two sets of data, i.e.
SELECT 1 AS [RowType],
'Brockton Hospital' AS [col1],
...
April 7, 2016 at 6:17 am
Viewing 15 posts - 436 through 450 (of 3,543 total)