Viewing 15 posts - 751 through 765 (of 1,396 total)
Style-wise, the joins are specified in "more specific to less specific" order which imo is not the standard way and it's less read-able. Without knowing anything about the underlying data...
January 7, 2021 at 6:06 pm
The query references "a couple of joined tables" but the code listed only has 1 table 't' in the FROM clause. The error message "multi-part identifer ..." happens when the...
January 6, 2021 at 9:08 pm
The nested subqueries seem not to be necessary imo. What is the point of selecting the top 15 rows only to select the top 1 from that subset using the...
January 5, 2021 at 10:30 pm
It appears the OP is referencing Excel functions and column arrays. In this query the calculated NewColumn equals the DesiredColumn.
drop table if exists #tTable;
go
create table #tTable(
...
January 5, 2021 at 12:31 pm
Awesome stats. Thank you good sir. And, based on your previous replies, the other 13 or so all start at "0"?
Yes, the other 13 start with 0, meaning 'dbo.fnTally(0,...
January 4, 2021 at 3:47 pm
I use 2 monster .sql scripts to answer SSC/SO questions. One currently has 13,787 lines and contains 32 occurrences of 'fnTally' of which 24 specify the sequence begin with 1. ...
January 4, 2021 at 1:17 am
Thanks for the feedback, Steve. So, from the sounds of it, you don't use a starting value of other than "0" or "1", correct?
Those are my two choices so...
January 3, 2021 at 11:31 pm
Getting back to Itzik's challenge, I had a question form in my mind. As a pre-amble to the question, I've found that I use "1" as a starting number...
January 3, 2021 at 10:47 pm
I think maybe it should be 'where c.id=o.cust_id' 🙂
January 3, 2021 at 6:29 pm
The table #tmpTabl specifies the column 'id' twice. Presumably the second 'id' is the unique identifier of the 'orders' table so here it's renamed as 'o_id'.
drop table...
January 3, 2021 at 5:30 pm
How about "This string is a space separated string"?
will this function work?
By "work" if you mean "give the right answer" then no. It doesn't return any error though. But...
December 26, 2020 at 1:15 pm
Yes the logic is broke. I agree with all of Alan's comments. It seems possible to take corrective steps using cte(s) and additional windowing functions where the cardinality of the...
December 26, 2020 at 2:47 am
Hey, Jeff, will you update this yet again to include the new split_string() function in SQL Server 2016+?
Probably not. The STRING_SPLIT function is relatively crippled for those that...
December 25, 2020 at 5:23 pm
drop table if exists #Stats2;
go
CREATE TABLE [dbo].#Stats2
([StatsDate] [datetime] PRIMARY KEY,
[TypeA_Calls] [int] NULL,
...
December 21, 2020 at 6:12 pm
What if there is more than one 'Period Key' for a (Support_Start_Date, Support_End_Date) pair?
Maybe you're looking for something like this? It returns multiple rows if the (Support_Start_Date, Support_End_Date) pair spans...
December 18, 2020 at 9:56 pm
Viewing 15 posts - 751 through 765 (of 1,396 total)