Viewing 15 posts - 91 through 105 (of 1,438 total)
Try this
with src as (
select day,budgethead,sum(amount) as amount,row_number() over(partition by day order by budgethead) as rn
from [dbo].[exp]
group by day,budgethead
)
select isnull(max(case when day=1 then budgethead end),0) as Day1,
...
September 17, 2019 at 3:50 pm
This is a gaps and islands problem
WITH Src AS (
SELECT SampleDate, SampleValue,
ROW_NUMBER() OVER(ORDER BY SampleDate) -
ROW_NUMBER() OVER(PARTITION BY SampleValue ORDER BY SampleDate) AS grp
FROM #SampleRanges
)
SELECT MIN(SampleDate) AS...
September 3, 2019 at 3:14 pm
Not a full solution, but see if this helps
WITH Src AS (
SELECT VEHICLEID,LAT,LON,MSGDATE,MSGTIME,SPEED,CRETIME,
DATEADD(SECOND,MSGTIME,CAST(CAST(MSGDATE AS VARCHAR(8)) AS DATETIME)) AS MSGDATETIME,
ROW_NUMBER() OVER(PARTITION BY VEHICLEID ORDER BY MSGDATE,MSGTIME) AS rn
FROM...
May 9, 2019 at 9:32 am
Have you looked at synonyms for this?
April 8, 2019 at 11:44 am
March 28, 2019 at 5:18 am
For .NET use SqlBulkCopy, for native e.g. C/C++ use BCP ODBC.
March 13, 2019 at 8:18 am
March 7, 2019 at 7:54 am
There's a ton of info here
https://docs.microsoft.com/en-us/sql/xquery/xquery-language-reference-sql-server?view=sql-server-2017
February 26, 2019 at 8:31 am
SELECT
c.query('
let $a := .
return...
February 26, 2019 at 6:03 am
December 12, 2018 at 8:29 am
SELECT 'Attribute ' + t.c.value('local-name(.)', 'varchar(50)') + ' : ' +
t.c.value('.', 'varchar(100)') AS Result
FROM @x.nodes('/SessionStart/*//attribute::*') AS t(c);
December 12, 2018 at 8:09 am
Viewing 15 posts - 91 through 105 (of 1,438 total)