Viewing 15 posts - 346 through 360 (of 4,081 total)
Glad it helped, Nikki, but please take to heart the warning that SQL tables have no sequence unless you can ORDER BY on a column. If you are...
August 24, 2016 at 6:19 am
Wait, I missed this.
CREATE UNIQUE INDEX IX_IX ON Table (Col1, Col2)
You're only skipping rows 1-8 where col1 = 10
Unless you go up to thousands of values in...
August 23, 2016 at 9:29 pm
I'd want to compare execution plans because this is clunkier lookin, but you might also try
SELECT ... WHERE Col1 = @Param1 AND Col2 > @Param2
UNION ALL
SELECT...WHERE...
August 23, 2016 at 9:16 pm
Pssst... "MIAMI"
Also, I'm missing something.
Why not just select where [Statename] <> 'ALL' ?
August 23, 2016 at 9:03 pm
VALUES is not a table. It is a table value constructor, because the values clause can contain expressions which are used to construct the actual values produced. ...
August 23, 2016 at 7:26 pm
Two examples:
(1) A is friends with B who is a friend of C. B is a mutual friend.
(2) A is friends...
August 23, 2016 at 6:57 pm
Drew, the pattern of this data is what I think of as header/detail data. One very significant "S" row followed by a bunch of "B" rows. ...
August 23, 2016 at 2:19 pm
No need to LAG. Summary Functions are windowed too. It reads much cleaner.
select PK_S, MonthDate,Leavers
,SUM(Leavers) OVER(ORDER BY PK_S DESC
...
August 23, 2016 at 1:12 pm
I think by "last" he means the last buy on the list before an S appears (reading top to bottom). That would actually be the...
August 23, 2016 at 12:29 pm
I see what you are after, but I have a question. Why is your buy for 108.58 associated with both sells at the top ( of 109.28...
August 23, 2016 at 9:11 am
Like this? I had to change the data to make some combination work with what you are describing. Your sample gave NO combination which would work. Also,...
August 22, 2016 at 7:58 pm
Why be that chatty? Paying network overhead twice?
August 22, 2016 at 8:21 am
I'm reading that one large input table needs to be split and merged into three tables which are subsets of the imported table. That isn't complicated. And...
August 21, 2016 at 5:03 pm
This should work, but I really don't like your input data set. You are showing the text for colors AND their codes, the sizes AND their codes. ...
August 21, 2016 at 1:44 pm
Viewing 15 posts - 346 through 360 (of 4,081 total)