Viewing 15 posts - 2,401 through 2,415 (of 4,085 total)
Also, my approach can easily be used with derived tables, again being consistent. You're approach could quickly become cumbersome with derived tables.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 8, 2016 at 9:55 am
david.wright-948385 (9/8/2016)
Phil Parkin (9/8/2016)
I disagree. It makes perfect sense. He *always puts ON clauses on separate indented lines* – perfectly consistent.
That's the point I'm making - it's consistent, but no...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 8, 2016 at 9:39 am
The Dixie Flatline (9/8/2016)
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 8, 2016 at 8:58 am
What are your expected results? It's certainly not clear from your description.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 7, 2016 at 3:03 pm
Are you by any chance looking for this?
SELECT TOP(5) * FROM TopSellerInstrumentsLastWeek i
FULL OUTER JOIN TopSellerScoringLastWeek sc
ON i.pf_id = sc.pf_id
FULL OUTER JOIN TopSellerStyleLastWeek st
ON i.pf_id = st.pf_id
OR sc.pf_id = st.pf_id
ORDER...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 7, 2016 at 1:14 pm
Luis Cazares (9/7/2016)
colin.dunn (9/7/2016)
Put the join ON clauses on the same line since they were so short.
I usually have my ON clauses on the same line as my JOIN, but...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 7, 2016 at 9:56 am
20,000+ rows does not constitute SAMPLE data. If you need more than 100 rows to illustrate your problem, then it's too complex for a free forum. Why...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 6, 2016 at 4:15 pm
You need to set the user's default schema.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 6, 2016 at 3:15 pm
There are several issues here.
1) Your data is not in a format that people can cut and paste it into SSMS to get started. Follow the instructions in...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 6, 2016 at 2:29 pm
The Dixie Flatline (9/5/2016)
SUM([CY_Quantity]) OVER (PARTITION BY [Customer], [Product], [Year]
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 6, 2016 at 12:56 pm
If you're not sure, instead of using an "OR", add another CASE. This will both make it easier to understand your logic and prevent problems with not specifying the...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 6, 2016 at 12:20 pm
Lynn Pettis (9/1/2016)
ScottPletcher (9/1/2016)
Luis Cazares (9/1/2016)
drew.allen (9/1/2016)
First, the mantra is "It's a bad idea to declare a cursor. Period. End of sentence." 😀Drew
Second, cursors can be local or global and...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 1, 2016 at 2:03 pm
First, the mantra is "It's a bad idea to declare a cursor. Period. End of sentence." 😀
T-SQL is not C#. It's certainly easy enough to test.
DECLARE @i INT =...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 1, 2016 at 12:02 pm
One thing I noticed is that you spread out Aj_total into different balances based on Age, and then the next thing you do is a series of queries to collapse...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 1, 2016 at 10:51 am
Your database is not normalized properly. If you can, you'd be better off fixing that rather than trying to code around it.
It always helps to provide sample data in...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
August 31, 2016 at 4:01 pm
Viewing 15 posts - 2,401 through 2,415 (of 4,085 total)