Viewing 15 posts - 3,091 through 3,105 (of 4,087 total)
kaushal_shah26 (8/2/2012)
August 2, 2012 at 9:18 am
kaushal_shah26 (8/2/2012)
August 2, 2012 at 7:20 am
You're better off using a CTE than the CROSS APPLY.
WITH ActiveUpdates AS (
SELECT [ID], SortOrder, isActive, ROW_NUMBER() OVER( ORDER BY SortOrder DESC, [ID] ) - 1 AS rn
FROM @CustomerConditions
)
UPDATE ActiveUpdates
SET...
August 2, 2012 at 7:18 am
dan-572483 (8/1/2012)
August 1, 2012 at 11:16 am
mandoswork (8/1/2012)
August 1, 2012 at 11:11 am
A GROUP BY with CASE expressions is likely to perform better, because it requires fewer scans and logical reads of the base table.
SELECT Sales_CustomerID
FROM @sales1
GROUP BY Sales_CustomerID
HAVING COUNT(CASE WHEN Sales_Status...
August 1, 2012 at 9:31 am
JayWinter (7/31/2012)
I did remove the GROUP BY and and achieved the correct result. My original post shows a 2nd script without GROUP BY.
Your DISTINCT clause is hiding the problem. ...
July 31, 2012 at 12:58 pm
You're looking for tables name AuditRecCount, DocumentRecCount, and FileRecCount, but the tables are named AuditRecord, Document, and File respectively. Since the names don't match, there are no values to...
July 26, 2012 at 10:21 am
SSMS doesn't display the entire field. I think that it only displays 255 characters by default. If you are trying to view the contents of the variable in...
June 26, 2012 at 11:10 am
No, the DISTINCT masks the problem with the join creating false "duplicates" in the sum. The GROUP BY only masks this same problem in a different way. The...
June 26, 2012 at 7:31 am
Reddy Ksr (6/26/2012)
Deleting the records by joining more than one table is not possible.for example:
delete from EMP inner join dept
on emp.deptno=dept.deptno and dept.deptno=50
error:
Incorrect syntax near the keyword 'inner'.
thanks,
kumar
Actually, it is....
June 26, 2012 at 7:07 am
I don't think that using DISTINCT is the correct way to solve this problem. DISTINCT will ignore ALL duplicate values, not just the ones caused by your join. ...
June 25, 2012 at 7:22 am
Lowell posted his script, so I don't need to find a link. I think his calculation for Julian Day can be simplified to DATEPART(dy, YourDateField), but you need an...
June 22, 2012 at 3:52 pm
I don't think that your sample values are correct. June 22, 2012 is 102 days after Feb 3, 2012. If you only want to count paid days, are...
June 22, 2012 at 3:46 pm
brosspaxedi (6/21/2012)
I'm not sure why you couldn't open the image. It is a .png, which might not be supported by your browser.
The site is blocked by my company.
Drew
June 21, 2012 at 1:33 pm
Viewing 15 posts - 3,091 through 3,105 (of 4,087 total)