Viewing 15 posts - 6,601 through 6,615 (of 10,144 total)
Try LEFT JOINing [ODS].[AC_Snapshot] again (with a different alias).
October 14, 2011 at 10:20 am
Jeff Moden (10/14/2011)
To add to ChrisM's code, please see the following article on how to display smaller hierarchies likes this...
Teach a guy to fish - I'd like to add that...
October 14, 2011 at 9:15 am
Closer, but still no cigar:
SELECT
RTRIM(First_name) + ' ' + RTRIM(Last_Name),
RTRIM(First_name) + CASE WHEN RIGHT(First_name,1) = ' ' THEN ' ' ELSE '' END + RTRIM(Last_Name),
...
October 14, 2011 at 8:32 am
Ninja's_RGR'us (10/14/2011)
adlakha.22 (10/14/2011)
Your query worked great when I tried with distinct.But still its taking 83 Seconds to execute.
Do you have any other idea to make it more optimize.
Thanks in advance
Post...
October 14, 2011 at 8:13 am
;WITH tree AS (
SELECT DISTINCT uid, cat_parent, cat_name, node = 0
FROM #temp where cat_parent = 0
UNION ALL
SELECT t.uid, t.cat_parent, t.cat_name, node = l.node+1
FROM tree L
INNER JOIN #temp t ON l.uid...
October 14, 2011 at 7:27 am
20x faster! I'm going home...:blush:
October 14, 2011 at 7:11 am
Anytime Phil. Test them both, I reckon Lowell's MegaCASE will win hands down.
October 14, 2011 at 7:04 am
Lowell (10/14/2011)
October 14, 2011 at 6:50 am
Something similar to this outperforms the obvious pivot approach for removing the blanks from address elements:
select t.*, x.ColIndex
from @Tab1 t
CROSS APPLY (SELECT TOP 1 ColIndex from (
SELECT ColIndex =...
October 14, 2011 at 6:34 am
Can you confirm which version of SQL Server you are using? There's no 2003 version.
October 13, 2011 at 7:49 am
Junglee_George (10/13/2011)
Chris, whats on your mmind..Which Method is better..first or second..??
Easy - test them 😉
It's an unrestricted update though, one pass is likely to be better than two or more.
October 13, 2011 at 6:02 am
No problem. This relies heavily on the testing framework which Jeff Moden et al set up for his excellent string splitter article[/url].
Here's the rCTE code:
CREATE FUNCTION [dbo].[DS8K_rCTEa](@pString [varchar](8000), @pDelimiter [char](1))
RETURNS...
October 13, 2011 at 5:59 am
codebyo (10/13/2011)
October 13, 2011 at 5:26 am
Bearing in mind that you are aggregating quite a few columns from a million or so rows down to 140,000, this query will always take some time to run. However,...
October 13, 2011 at 5:15 am
Good catch, Drew. I was about to point it out with evidence:
USE tempdb
GO
CREATE TABLE tblUCSU (strlocation VARCHAR(10), strPen INT)
INSERT INTO tblUCSU (strlocation, strPen)
SELECT 'London', 1 UNION ALL
SELECT 'New York',...
October 12, 2011 at 8:48 am
Viewing 15 posts - 6,601 through 6,615 (of 10,144 total)