Viewing 15 posts - 5,176 through 5,190 (of 10,144 total)
mamzy.rahman (2/26/2013)
HI thanks for your help but it came up with an errorincorrect syntax near the keyword 'group'
highlights groub by l01, l03
The derived table - subselect - requires an alias.
February 26, 2013 at 3:34 am
SET DATEFORMAT DMY
CREATE TABLE #TEMP (LogIndex int, UserID nvarchar (10), LogTime datetime)
insert into #temp select 1, '01551 ', '20/02/2013 17:41:45.000' --
insert into #temp select 2, '01551 ', '20/02/2013 17:41:45.900'
insert into...
February 25, 2013 at 9:47 am
Thanks. The plans for each of the MERGE statements are very similar. Here's what I suggest you do; pick one of the statements and work with it in a query...
February 25, 2013 at 8:01 am
;WITH CTEAgg AS (
SELECT
GroupingID,
GroupItemCount = COUNT(*) OVER (PARTITION BY GroupingID),
[Description]
FROM #TEMP
)
SELECT DISTINCT t.GroupingID, Item
FROM #TEMP t
OUTER APPLY (
SELECT Item = STUFF(
(
SELECT ','+Item
FROM (
SELECT Item, GroupItemCount, [Description]
FROM...
February 25, 2013 at 7:57 am
sathiyan00 (2/25/2013)
hi ,i attached actual execution plan of my proc..please find attachment(results.txt)...
Can you save it as a .sqlplan file and post, please?
February 25, 2013 at 6:52 am
Can you please post the actual execution plans of all three merge statements.
February 25, 2013 at 5:52 am
February 25, 2013 at 5:13 am
Can you finish it from here?
;WITH CTEAgg AS (
SELECT
GroupingID,
GroupItemCount = COUNT(*) OVER (PARTITION BY GroupingID),
[Description]
FROM #TEMP
)
SELECT GroupingID, Item
FROM (
SELECT
GroupingID, GroupItemCount, [Description], Item
FROM CTEAgg
CROSS APPLY...
February 25, 2013 at 5:05 am
SELECT *
FROM (
SELECT *,
Chunk = 1+(ROW_NUMBER() OVER(ORDER BY stress)-1)%4
FROM #stress
) d
ORDER BY Chunk, Stress
February 25, 2013 at 4:31 am
L' Eomot Inversé (2/22/2013)
mister.magoo (2/22/2013)
And here is the code (with notes removed for brevity) and the changes underlined.Sorry if I have made a mistake, but I think this is valid.
Looks...
February 22, 2013 at 7:53 am
dwain.c (2/22/2013)
Have you tried the solution I suggested?I'm thinking it will do what you need.
I hope I didn't confuse you by putting Table2 into the CTE.
Looks good to me. Same...
February 22, 2013 at 3:56 am
I'm not so sure either - the tables might look like this:
DROP TABLE #Table1
SELECT
*
INTO #Table1
FROM (
SELECT Column1 = 'microsoft outlook 2007,microsoft 2007 outlook,microsoft out look 2007,microsoft 2007 office,microsoft office...
February 22, 2013 at 1:13 am
wafw1971 (2/21/2013)
I have 4 million lines of code....
Four million lines of code would keep you quiet for a while! I guess you mean four million rows in a table?
Read...
February 21, 2013 at 8:34 am
chandrakant_gaurav (2/21/2013)
Its embarassing :blush: . Thank you!!
Heh - don't be embarrassed, you almost got there. Thanks loads for posting a sample script.
February 21, 2013 at 7:06 am
So nearly there...
SELECT
calldate,
Overall= SUM(talktime),
A_Talktime= SUM(case when ID = 1 then talktime END),
B_Talktime= SUM(case when ID = 2 then talktime END),
C_Talktime= SUM(case when ID = 3 then talktime END)
FROM...
February 21, 2013 at 6:25 am
Viewing 15 posts - 5,176 through 5,190 (of 10,144 total)