Viewing 15 posts - 961 through 975 (of 4,081 total)
I STRONGLY agree with Lowell. You are shooting yourself in the foot by storing the datetime information as varchar. You are losing the entire...
July 21, 2011 at 3:29 pm
It depends. The Row_Number() technique wins at low volumes and the MAX() function performs better as you start moving up to to tens of thousands of rows....
July 21, 2011 at 3:17 pm
This post intentionally left blank.
July 21, 2011 at 2:26 pm
bubs,
This may be an irrelevant question, but how many rows are you planning on running against? If this is a one time shot it's...
July 21, 2011 at 2:11 pm
I am about to go out of town for several days, so this will be my last post, but you seem to be on the right track. ...
July 21, 2011 at 1:00 pm
I don't really know of anything more "comprehensive". Ranking is based on a criteria of some sort which must be defined. In your example for...
July 21, 2011 at 11:04 am
Chrissy,
Please note that the query using the revised design provides output in this format
Staff_ID Phone_nbr
1 ...
July 21, 2011 at 9:13 am
Sounds like an interesting problem, but we need a little more help before we can offer a solution.
Could you give us a little more information?
What would...
July 20, 2011 at 4:07 pm
You're welcome.
CTEs are just like views, except you define them for the duration of a single query.
Alternatively, think of them as subqueries that you read from top to bottom,...
July 20, 2011 at 2:16 pm
Try this instead of the PIVOT. See if it helps.
select site
, sum(case when [status] = 'Available' then 1 else 0 end) as Available
, sum(case when [status]...
July 20, 2011 at 1:19 pm
Here's a shot at your first requirement. For a high-volume table I'd probably use a cursor, or even let the calling application highlight the consecutive rows....
July 20, 2011 at 1:10 pm
You get an A+ for setting up the problem so perfectly. Thank you so much!! 😀
Here's a solution for you
select StaffID
,COALESCE(case...
July 20, 2011 at 12:48 pm
GilaMonster (7/20/2011)
Ninja's_RGR'us (7/20/2011)
GilaMonster (7/20/2011)
Jeff Moden (7/20/2011)
I understand that Gail Shaw will be co-presenting with you...Yup, Grant and I are doing comed^H^H^H^H^H execution plans as a precon on the Monday.
What...
July 20, 2011 at 9:17 am
... and he feeds pork chops to the hungry multitudes.
July 19, 2011 at 3:37 pm
Call the people at SETI[/url]. 😀
Seriously, I think T-SQL may be the wrong tool for the job of discovering undefined patterns. This sounds like it's more in...
July 19, 2011 at 10:56 am
Viewing 15 posts - 961 through 975 (of 4,081 total)