Viewing 15 posts - 3,271 through 3,285 (of 3,406 total)
I was going to add that viewing an entire table could be a bad idea. Imagine viewing the entire contents of a Fact table in a Data Warehouse with...
August 12, 2013 at 12:41 pm
Thanks Koen, at least now I know if I need to upgrade yet. (Apparently not!)
One sort of follow-up question... I was looking on here for how to execute...
August 12, 2013 at 12:39 pm
Use ROW_NUMBER().
This is close, but not quite right...
WITH SomeNumbers AS
(
SELECT c1, c2,
ROW_NUMBER() OVER (ORDER BY c1) AS RowNumber
FROM #t1
)
SELECT x.c1
, x.c2
, x.PrevC2
, x.c2-COALESCE(x.PrevC2,0) AS Delta
FROM (SELECT s1.c1
, s1.c2
--, s1.RowNumber
--, s2.c1...
August 10, 2013 at 7:34 pm
Okay, got it finally. Thanks!
The trick that I wasn't seeing was that you can't filter on the column with the multi-valued parameter in the stored procedure, you have to...
August 9, 2013 at 7:08 pm
Koen Verbeeck (8/9/2013)
You need to...
August 9, 2013 at 1:05 am
Chris,
thanks for the examples. I'm going to read up more and see if I can get my head around Paul White's articles on CROSS and OUTER APPLY and...
July 30, 2013 at 1:56 pm
Select ISNULL(Value, 'Not Defined') as Value
from #mytable
UNION
Select Value AS Value
FROM #mytable
Order by Value
How about
SELECT ISNULL(Value, 'Not Defined') AS Value, 0 As SortOrder'
FROM #mytable
UNION
SELECT Value, 1
FROM #mytable
ORDER BY Value, SortOrder
July 22, 2013 at 9:49 am
Reading Kimball's book on Data Warehousing isn't a bad place to start. It's a great introduction to the concepts in DW design and modeling. But it's definitely true...
July 22, 2013 at 9:46 am
I did it with a Matrix report.
Row: ProductDate
Column: PersonName
Intersection (value): ProductName
or did it have to be in query?
July 12, 2013 at 9:52 am
I think that will work. I knew I had to be making it waaay harder than it really was.
Thanks!
July 9, 2013 at 8:23 pm
omid.shokri (7/7/2013)
This query is the part of a procedure.
I think no different these two query, but output of query 1 is without any row. In other word, "Inner...
July 7, 2013 at 10:09 pm
Is this homework? When you ran it, did you notice any differences?
OUTER joins show all the records from the LEFT table, and matches or nulls in the right side...
July 7, 2013 at 4:14 pm
Could be me, but I think you're making this infinitely harder than it really needs to be. If you think in terms of SETS and use pure SQL, you...
July 3, 2013 at 6:43 pm
This worked for me... (FWIW)
insert into temp (id, strg, [index])
values (1, 'abc', 1);
declare @strg varchar (5)
select @strg = case when ID = 1 and [INDEX] = 1
then strg
else cast(0 AS...
June 24, 2013 at 2:58 pm
Viewing 15 posts - 3,271 through 3,285 (of 3,406 total)