Viewing 15 posts - 91 through 105 (of 1,439 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,
...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
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...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
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...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
May 9, 2019 at 9:32 am
Have you looked at synonyms for this?
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
April 8, 2019 at 11:44 am
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
March 28, 2019 at 5:18 am
For .NET use SqlBulkCopy, for native e.g. C/C++ use BCP ODBC.
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
March 13, 2019 at 8:18 am
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
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
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
February 26, 2019 at 8:31 am
SELECT
c.query('
let $a := .
return...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
February 26, 2019 at 6:03 am
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
February 11, 2019 at 1:10 pm
This should do it
SELECT '001' AS "area",
(SELECT --'admin@company.com' AS "notify",
(SELECT 'TELRCM' AS "field/@table", 'COMPANY' AS "field/@field", Company AS "field", null,
'TELRCM' AS...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
February 8, 2019 at 5:27 am
Try this
SELECT '001' AS "area",
(SELECT 'admin@company.com' AS "notify",
(SELECT 'TELRCM' AS "field/@table", 'COMPANY' AS "field/@field", Company AS "field", null,
'TELRCM' AS "field/@table", 'POSTCODE'...
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
February 7, 2019 at 5:42 am
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
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);
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
December 12, 2018 at 8:09 am
See if this helps
https://support.microsoft.com/en-us/kb/323630
____________________________________________________
Deja View - The strange feeling that somewhere, sometime you've optimised this query before
How to get the best help on a forum
http://www.sqlservercentral.com/articles/Best+Practices/61537
March 8, 2018 at 3:36 am
Viewing 15 posts - 91 through 105 (of 1,439 total)