Viewing 15 posts - 2,356 through 2,370 (of 3,957 total)
lmeinke,
I see where you added the sales_rank column but I don't see how that adversely affects the results. So let's modify the final select slightly.
CREATE TABLE #SalesByEmployeeCategory
(Category VARCHAR(100)
...
December 18, 2012 at 8:15 pm
The thing about the Quirky Update is that it's, well... quirky.
Sometimes you'll need to play with it a might to get the results you expect.
I'll look at this again but...
December 18, 2012 at 4:32 pm
:hehe: It will tend to do that the way I fudged the grouping factor.
Just goes to show that thorough test data is the best way to a good solution.
What about...
December 18, 2012 at 5:52 am
As the holiday season rapidly approaches, I'd like to take a minute to wish everyone on this forum a Merry Christmas and very happy New Year.
The first anniversary of my...
December 18, 2012 at 5:49 am
I can try. 😉
The ORDER BY is split into two levels:
1. First the characters, which get assigned the empty string when the value is a numeric (which will sort before...
December 18, 2012 at 12:36 am
Not very elegant but you might be able to use something like this, assuming your intent is to sort numbers first as numbers followed by non-numeric characters:
CREATE TABLE #varchar_field1 (...
December 17, 2012 at 11:04 pm
Chris-475469 (12/17/2012)
Yeah you're right!I thought datetime2 was supposed to consume less bytes than datetime depending on the precision used?
I'll check MSDN again.
Actually I didn't check the byte-size difference - that...
December 17, 2012 at 8:50 pm
Chris-475469 (12/17/2012)
It looks like we'll be having another discussion on datetime...
December 17, 2012 at 8:37 pm
Chris-475469 (12/17/2012)
The developers will argue it'd be quicker to change the...
December 17, 2012 at 7:44 pm
Personally I've never tried it but a quick test of this:
SELECT CAST('2012-01-01' AS DATETIME2)
If you copy/paste the result into Excel it can be formatted as a date with nor problem.
As...
December 17, 2012 at 7:28 pm
DataAnalyst011 (12/17/2012)
What is the difference between...
WHERE [column] IN ([subquery])
and
WHERE EXISTS ([subquery])
?
I've been trying to read on...
December 17, 2012 at 7:17 pm
Another way:
DECLARE @spitme TABLE (Item varchar(40));
INSERT @spitme VALUES ('HEYE-B Euro-IPA 69793'), ('HEYE-B RFE-IPA 70940');
SELECT STUFF(STUFF(Item, 1, CHARINDEX(' ', Item), ''), CHARINDEX(' ', STUFF(Item, 1, CHARINDEX(' ', Item), '')), LEN(Item), '')
FROM...
December 17, 2012 at 6:40 pm
If you think those "typos" that pass SQL Server's parser seem weird, try this one:
SELECT 7+$
December 17, 2012 at 6:31 pm
Obviously this is some sort of diabolically silly test of your knowledge of windowing functions:
create table #TestTask1 (Name varchar(1), Territory Varchar(1), sales_amount int);
insert into #TestTask1 values ('A','X',100)
insert into #TestTask1 values...
December 17, 2012 at 6:21 pm
lmeinke (12/17/2012)
dwain.c (12/14/2012)
lmeinke (12/14/2012)
I was actually replying to dwain c. but I do thank you as well. I was out of the office for a few days and didn't...
December 17, 2012 at 6:08 pm
Viewing 15 posts - 2,356 through 2,370 (of 3,957 total)