Viewing 15 posts - 271 through 285 (of 399 total)
Well, if that's all it is, then great. I tend to overblame myself. I was sure it was me.
Well, Joe Celko forewarded the book. I would have thought...
March 3, 2013 at 4:04 pm
But this works (a subsequent lesson)....and the only difference is the SELECT seq=IDENTITY(int). "This approach uses the IDENTITY() function with SELECT...INTO to add an identity column to the work table....
March 3, 2013 at 3:41 pm
Reiterating problem. This works:
--DDL for creating and populating staff table
create table staff(employee int primary key, employee_name varchar(10),
supervisor int null references staff (employee))
insert staff
values
(1, 'groucho', 1),
(2, 'chico', 1),
(3, 'harpo',...
March 3, 2013 at 2:15 pm
OK, I'll check these links out but in the end I know I will come around to wanting to understand KH's chapter. His code the 'long way' works, but...
March 3, 2013 at 1:54 pm
Yes, I think I read on a post elsewhere that if the servers go up and down often, might need to build an application to maintain counter numbers throughout the...
March 3, 2013 at 12:02 pm
Thank you Lowell, for your thorough answer.
Yes, I did recognize that your query provided counters, and that is what I was after.
And now I can see that the UNION...
March 3, 2013 at 11:29 am
Hi Daglugub, sorry I didn't see this sooner. Need to get notifications sent to a more often used email inbox, which I will do right way. But, I am...
March 3, 2013 at 10:16 am
what is difference between
user_seeks
user_scans
user_lookups
user_updates?
February 27, 2013 at 11:06 pm
I was just coming back here to post that I'd found a query that retrieves last_user_seek, but no counters and Lo!
Holy Goodness, this is great. Thanks Lowell.
I do have...
February 27, 2013 at 10:37 pm
googling dm_db_index_usage_stats or sys.dm_db_index_usage_stats. Thanks.
February 27, 2013 at 3:30 pm
ooh man, you got my back. Thanks. would'a goofed with that in my next interview 🙂
February 27, 2013 at 12:21 am
Daglugub, how about this?
--DDL to set up environment
create table userassignments (id int, userid int, companyname varchar(50));
insert into userassignments
values
(1, '1', 'companyA'),
(2, '1', 'companyB'),
(3, '2', 'companyB'),
(4, '2', 'companyC'),
(5, '3', 'companyA'),
(6, '3',...
February 26, 2013 at 10:41 pm
SQL_Enthusiast,
I double and triple checked the book and the WHILE query in my original post is a facsimile.
The where clause condition is slightly different, it excludes o1.supervisor<>o1.employee. ...
February 25, 2013 at 10:21 am
So, group by limits you to one aggregation, and PARTITION BY allows for multiple groupings. Thanks Dwain.
September 18, 2012 at 11:34 pm
John Mitchell, I see that the solution works. It's nice. I understand CTE and 'PARTITION BY YEAR(OrderDate)' etc., but will you please explain why 'PARTITION BY 1'?
September 18, 2012 at 5:36 pm
Viewing 15 posts - 271 through 285 (of 399 total)