Viewing 15 posts - 2,071 through 2,085 (of 4,085 total)
Phil Parkin (12/22/2016)
IF OBJECT_ID('tempdb..#tmp', 'U') IS NOT NULLDROP TABLE #tmp;
CREATE TABLE #tmp
(
FormulaId CHAR(2)
, IngredientId CHAR(2)
);
INSERT #tmp
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 22, 2016 at 11:20 am
Not necessarily. The problem is when a field from an outer table is used in a JOIN condition (or WHERE clause) without taking into account that it might be...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 22, 2016 at 10:12 am
Thom A (12/22/2016)
WITH CTE (EVENT_ID, EVENT_RANK, MIN_AGE, MAX_AGE, C_MIN, C_MAX) AS
(
SELECT A.EVENT_ID,
A.EVENT_RANK,
A.MIN_AGE,
...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 22, 2016 at 9:37 am
Manic Star (12/21/2016)
jasona.work (12/21/2016)
Ed Wagner (12/21/2016)
jasona.work (12/21/2016)
Ed Wagner (12/21/2016)
Revenant (12/21/2016)
GulfFishing
Ice
Lake
Huron
Bird
Archeopteryx
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 21, 2016 at 1:56 pm
Something along the lines of the following.
SELECT c.value('@name', 'VARCHAR(50)')
FROM @doc.nodes('/xs:schema/xs:element/xs:complexType/xs:sequence/xs:element[2]/xs:complexType/xs:sequence/xs:element[1]/xs:complexType/xs:sequence/xs:element') T(c)
You may need to use a CROSS APPLY if the XML is stored in a column instead of a variable....
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 21, 2016 at 1:37 pm
whenriksen (12/21/2016)
DK13 (12/20/2016)
NULL is a valid action type.
I'll save Celko the effort here. NULL is not a valid action type. It is messing up your results because you...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 21, 2016 at 10:39 am
You're using a subquery to get the rank when you should be using ROW_NUMBER().
/*ranking*/
SELECT compmcd.hedismeasure,
compmcd.measureid,
compmcd.competitor,
compmcd.market,
compmcd.prodabbrev,
compmcd.hedisrate,
ROW_NUMBER() OVER(PARTITION BY measureid, market, prodabbrev ORDER BY hedisrate DESC, measureid DESC ) AS rn
FROM...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 20, 2016 at 4:22 pm
matthew.livingston (12/20/2016)
Not sure if it is okay to post this here, but if this is correct, it will help everyone understand better. OP could help verify.pages 365-367
Yes, it looks like...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 20, 2016 at 4:13 pm
sgmunson (12/20/2016)
-- code snipped to pinpoint this section
SELECT D.*,
CAST(D.[Date] AS date) AS DATE_ONLY,
CASE
WHEN CAST(LEAD(D.[Date], 1, '9999-12-31') OVER(ORDER BY D.[Date]) AS date) =...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 20, 2016 at 3:53 pm
Jason A. Long (12/20/2016)
IF OBJECT_ID('tempdb..#Data', 'U') IS NOT NULL
DROP TABLE #Data;
CREATE TABLE #Data (
ID VARCHAR(20),
SEQ INT,
Date...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 20, 2016 at 3:32 pm
Most approaches that I've seen collapse the ranges. That is, they don't retain a record with a zero length. Is there a particular reason that you need to...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 20, 2016 at 2:14 pm
Your DateKey is defined as INT. Don't provide your sample data as CHAR, because it forces an implicit conversion.
You say that your data contains NULLs which are causing you...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 20, 2016 at 2:03 pm
Brad Feaker-195979 (12/20/2016)
Got the same results - but thanks...
The query I gave you will produce a row with NULL values for the grouped fields. Since your results DO NOT...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 20, 2016 at 10:49 am
I suspect what you want is
GROUP BY GROUPING SETS((EDI_Batch_Number, Reference_2),())
which will give you groups by EDI_Batch_Number/Reference and then a grand total.
What you currently have gives your one group on...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 20, 2016 at 8:50 am
jasona.work (12/19/2016)
Phil Parkin (12/19/2016)
jasona.work (12/19/2016)
Rouge 1 (have now saw it twice)So you should certainly know how to spell it by now! :hehe:
*I* spelled it correctly, just check the post!
(and ignore...
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
December 19, 2016 at 3:13 pm
Viewing 15 posts - 2,071 through 2,085 (of 4,085 total)