Viewing 15 posts - 691 through 705 (of 897 total)
Please provide us some sample data to work with and the expected result. Post the same in a ready to use format so that people can give you a tested...
August 10, 2010 at 10:49 pm
If you are fetching all the records, then the Indexes will not be used and hence adding an Index will not make a difference.
August 10, 2010 at 6:35 am
You can use ROW_NUMBER() for the same
SELECT *
FROM(
SELECT ROW_NUMBER() OVER ( PARTITION BY dataId, code, imageName ORDER BY loadId...
August 9, 2010 at 12:05 pm
If i am understanding your requirement correctly you want to keep the GROUP BY Clause Dynamic. For this you can use a Dynamic Query like given below
DECLARE@strGroupByClause VARCHAR(1000)
DECLARE@strSQL VARCHAR(8000)
SET@strGroupByClause =...
August 9, 2010 at 2:08 am
This is too trivial to help you out with the actual code. Is this a home work question? Have a look at the SUM() function in Books Online. Get back...
August 9, 2010 at 12:53 am
See if this helps
; WITH cte_FALSEDESCRIPTION AS
(
SELECTROW_NUMBER() OVER( ORDER BY RequestID ) RowNum, *
FROMFALSEDESCRIPTION
WHERERequestID = ''
)
UPDATEcte_FALSEDESCRIPTION
SETRequestID = RowNum
Not tested as you did not provide the sample data to test with.
August 5, 2010 at 3:01 am
Try changing it with a sub query like this
SELECTweekdate,
case when version_id = LV.Version then 1 else 0 end as LatestVersion
FROM(
select MIN(DATEADD(wk,datediff(wk,0,timeuploaded),0))as weekdate
from telemetry
group by DATEPART(WW,timeUploaded), DATEPART(yy,timeUploaded)
) T
CROSS APPLYdbo.[GetLatestVersion] (...
August 4, 2010 at 12:05 am
I think you are looking for a CROSS APPLY
select MIN(DATEADD(wk,datediff(wk,0,timeuploaded),0))as weekdate,
SUM(case when version_id = LV.Version -- Changed here
then 1 else 0 end) as LatestVersion (If this xondition is not true...
August 3, 2010 at 11:41 pm
sc-w (7/30/2010)
UPDATE wce_contact
SET user1 = 'prospect Bath'
WHERE EXISTS
(SELECT h.NOTES, c.user1
FROM ...
July 30, 2010 at 6:37 am
Please post the UPDATE query that you are using. I can see only 2 SELECT queries.
And one more thing, there is no use of the LEFT OUTER JOIN. The Where...
July 30, 2010 at 5:38 am
Your Table Structures are not that clear. Please have a look at the link in my signature on How to post questions to get faster answers.
Anyways, I think what you...
July 25, 2010 at 10:34 pm
malleswarareddy_m (7/22/2010)
July 22, 2010 at 11:06 pm
Since you know that this can be done using ROW_NUMBER(), try some code yourself and if you are stuck, then come back with proper test data and the script with...
July 22, 2010 at 10:39 pm
Grant Fritchey (7/22/2010)
July 22, 2010 at 7:04 am
You still haven't got clearly what Paul explained. The Where Clause is not evaluated for the whole table at one go, It is evaluated on a row by row basis....
July 20, 2010 at 6:15 am
Viewing 15 posts - 691 through 705 (of 897 total)