Viewing 15 posts - 1,231 through 1,245 (of 2,171 total)
Sure. The error I get is "UNION ALL view 'Test.dbo.tOrder' is not updatable because a partitioning column was not found.".
I know in SQL Server 2005, you can even put the...
October 11, 2007 at 4:10 am
Instead of return 0.45 which in mathematical term is 45%, the algorithm returns 45.0, which most beginners find more appealing.
October 11, 2007 at 2:10 am
I don't think ENTERPRISE EDITION can be installed on MEDIA CENTER.
October 11, 2007 at 12:42 am
You may be right.
We'll never know until OP gets back.
Other times when I encountered requests for "DISTINCT" posted by people living in India, they have meant non-duplicates.
October 10, 2007 at 8:03 am
I think {1, 3, 4, 6, 8} is not the DISTINCT records.
They are one from each combination of Name and EmailID.
Maybe that is what OP really want?
Records {3, 8} are...
October 10, 2007 at 7:55 am
Op wrote "Now I want distinct records based on name and EmailId..."
If you want all DISTINCT records, use COUNT and RecID = 1
If you want all NON-DISTINCT records, use COUNT...
October 10, 2007 at 7:27 am
Jason Selburg (10/10/2007)
You want row_number() not count(*) ....
Why?
ALL groups of records always start with 1, both distinct and non-distinct groups...
October 10, 2007 at 7:14 am
If you ARE using SQL Server 2005, make sure COMPATIBILITY LEVEL is set to 90.
October 10, 2007 at 6:33 am
SELECTID,
Name,
EmailID,
Age,
Salary
FROM(
SELECTID,
Name,
EmailID,
Age,
Salary,
COUNT(*) OVER (PARTITION BY Name, EmailID) AS RecID
FROMTable1
) AS d
WHERERecID = 1
October 10, 2007 at 6:13 am
SELECT QuestionID,
Yes,
Yes / Answers,
No,
No / Answers,
Answers
FROM (
SELECT QuestionID,
SUM (CASE WHEN Answer = 1 THEN 100.0 ELSE 0.0 END) AS Yes,
SUM(CASE WHEN Answer = 0 THEN 100.0...
October 10, 2007 at 12:09 am
Use a CTE.
They are described in Books Online. There are also examples of how to traverse hierarchies with recursive CTE's.
October 9, 2007 at 11:51 pm
Very detailed information about why it doesn't work is posted here
October 9, 2007 at 11:49 pm
Delete rows in batches?
SET ROWCOUNT 20000
WHILE 1 = 1
BEGIN
DELETE FROM Table1 WHERE ID BETWEEN 200000 AND 2200000
IF @@ROWCOUNT = 0 BREAK
END
SET ROWCOUNT...
October 9, 2007 at 11:48 pm
SELECT SUM(CASE WHEN Col2 = 'qwerty' AND Col3 = 1 AND Col4 = 'Fast' THEN Col1 ELSE 0 END) AS 'Option1',
...
October 9, 2007 at 4:26 am
DECLARE @Sample TABLE (d DECIMAL(5, 4))
DECLARE @original DECIMAL(6, 4)
SET @original = 0.0
WHILE @original < 10.0
BEGIN
INSERT @Sample
SELECT @original
SET @original = @original + 0.0001
END
SELECT d AS OrignalValue,
REPLACE(REPLACE(REPLACE(RTRIM(REPLACE(REPLACE(STR(d, 15, 5), ' ', '#'),...
October 9, 2007 at 1:16 am
Viewing 15 posts - 1,231 through 1,245 (of 2,171 total)