Viewing 15 posts - 76 through 90 (of 1,360 total)
I need to be able to read the previous 5 Friday dates...
A good place to start could be with a query to generate the most recent 5 Friday dates...
March 1, 2024 at 9:45 pm
Here are two ways. My preference is for the second one. Since the FORMAT function was introduced in SQL Server 2012 (afaik) it's been known to have performance issues. Maybe...
February 28, 2024 at 6:44 pm
IMHO, Steve Collins' post (with a tiny tweak (change fn.n to fn.value) in the 2nd bit of code) contains the winning entries for simplicity IF you don't mind any...
February 20, 2024 at 6:56 pm
Using a tally function or GENERATE_SERIES maybe something like this
/* expand the date range using a tally function */
select v.calc_dt, count(*) active_policies
from #Policy p
...
February 16, 2024 at 6:03 pm
A while ago when I looked into GitHub Copilot, the service was based on ChatGPT-3.5 which is/was quite inferior imo to the ChatGPT-4 which was available at the time.
February 12, 2024 at 7:10 pm
Back in the day, before SQL Server 2012 was previewed, I worked on a project which started with a blank database. My teammate at the time started sending me articles...
February 9, 2024 at 1:25 pm
We'll have to see how the OP replies. Maybe my code only summed the part they want subtracted from the sum_qty
February 5, 2024 at 5:06 pm
All right, some data. This could be my only chance to use SQL for the day. For my part, this week and until it's done, I'm working on web development. ...
February 5, 2024 at 4:27 pm
Try this, maybe?
That old function could use an updating imo. As this is the 2022 topic GENERATE_SERIES and STRING_AGG are available. Also, not to say it's incorrect but...
January 29, 2024 at 4:13 pm
To make the selection criteria specific to each column you could try a conditional aggregation approach to pivoting the data
select TestID,
...
January 27, 2024 at 4:24 am
This question still has me thinking. How has development changed because of AI? There's more than one trend happening at once imo. For SQL the impact for me has been...
January 22, 2024 at 4:03 pm
Thanks alot guys, I think I've taken a bit from each of the 3 posts and have made progress. I've posted the new execution plan below. Seems to be...
January 14, 2024 at 9:08 pm
Disclaimer: this contains speculation and opinions
In broad terms, when considering performance, imo it makes sense to overlay the FROM clause with the execution plan. The FROM clause is read left-to-right...
January 14, 2024 at 4:36 pm
This query looks for the minimum previous appropriate enter_date for each row and then calculates the DATEDIFF. The sample was expanded to include a greater than 12 month gap
January 11, 2024 at 4:25 pm
"Gpt-4-1106-preview has training cutoff of 4/2022 and the context size is 16K (double the standard Gpt4)" Oops that was not correct. The cutoff for Gpt4-Turbo is 4/2023 and the context...
January 9, 2024 at 3:17 am
Viewing 15 posts - 76 through 90 (of 1,360 total)