Viewing 15 posts - 1 through 15 (of 1,380 total)
with stub_cte as (
select BName, StartDate, StartTime,
lag(StartDate) over (partition by v.stub...
February 22, 2025 at 9:44 pm
The @dateChoice variable is passed in from a dropdown box and the WHERE clauses between the two queries are different. Syntax-wise you could try IF @dateChoice = 'DOS' SELECT ... ...
January 24, 2025 at 1:28 am
The only relational operator which seems required is a partial CROSS JOIN of #tmp (WHERE 'parent_id' IS NULL) to #tmp (WHERE 'parent_id' IS NOT NULL) ON 'uniqueid'. Then it's a...
January 16, 2025 at 2:21 pm
In your JSON the outermost delimiter is an array bracket which means it's an anonymous array. To reference the only record in the array you could provide the 'path' to...
January 14, 2025 at 3:18 pm
In the function JSON_VALUE 'path' is a required parameter and in the tvf OPENJSON 'path' is optional. The implementation of 'json path' in SQL Server is a limited subset of...
January 12, 2025 at 3:44 pm
Where's your sample data? A calendar table determines the workdays? This is asking a bit. Using AVG OVER can only accept literal numbers in the RANGE PRECEDING and afaik it...
December 28, 2024 at 9:36 pm
You can combine the two deletes into a single delete.
WITH Combine_Colors AS
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY p.Airplane ORDER BY p.[Priority]) AS rn
FROM #Priority AS p
WHERE p.Color...
December 23, 2024 at 9:31 pm
Sorry, sorry my apologies. I didn't catch the inconsistency. The green arrows in the image you posted only point up! Afaik that's the part I missed. Once there's an accepted...
December 22, 2024 at 2:14 pm
Instead of 3 statements: "UPDATE Color, DELETE Color='White', UPDATE Priority", these 2 statements seem equivalent and simpler: "DELETE Color='White', UPDATE Color, Priority"
NOTE: As per the post below the code...
December 21, 2024 at 8:52 pm
Happy Holidays to SSC! Nicely done Phil. Hmm... an issue which could potentially screw up the solution is the lack of constraint(s) on the input table. Why are all of...
December 21, 2024 at 4:48 pm
That's a nice looking query Ken. The OP's query used "SELECT ... INTO #TEMP1" which could be a bottleneck to a larger process imo. Of course, it's not possible to...
December 20, 2024 at 5:05 pm
How could I last 15 minutes of activity pulling the unique record per minute
Scroll up a few posts and see Ken McKelvey's reply. Once t_stamp has been converted to...
December 13, 2024 at 2:24 pm
Well, I admit I've never used NOLOCK in a query. There hasn't been any project where NOLOCK is/was clearly required. The article doesn't actually put forward any performance metrics or...
December 12, 2024 at 9:21 pm
That would be true if working with a Normal date, but the Unix-Timestamp stored in T_stamp needs converted I'm thinking.
Yep, t_stamp stored as BIGINT could be converted to DATETIME2(3). ...
December 11, 2024 at 1:50 am
Or the paradox is an enigma wrapped in a riddle. The article is based on a musing which is factually unconfirmed. Or maybe I missed the convincing part(s)
December 9, 2024 at 2:15 am
Viewing 15 posts - 1 through 15 (of 1,380 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy