Viewing 15 posts - 1,036 through 1,050 (of 4,080 total)
How should I format my case solution to get in on the testing?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 7:48 pm
Fun problem. 😀
This solution might be a little less CPU intensive because the only string manipulation is done with ISNULL or CASE tests.
The trick is to squeeze out the...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 4:19 pm
The code below will return only rows 5,6,7,8 from the sample table.
; with SampleTable AS
(
SELECT *
...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 1:35 pm
So this original requirement is off the table now?
where count of Code >=2 group by GroupID
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 12:57 pm
Okay... so we want to see any group with two or more types that have two or more rows per type.
Now tell us again how codes fit into that. ...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 11:54 am
We're getting there. You only want to see groupIDs that have at least 2 members of each type. But what about this case?
Group 99...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 8:00 am
It may help to think of CTEs as views, since that's how they behave. Query plans generated from a CTEs may sometimes make use of a...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 6:53 am
What does your execution plan for the query show? Could you post it here please?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 6:49 am
Tommy is right. Adding CHAR(13) or even CHAR(13) + CHAR(10) to your output string does NOT create a new row. It just creates a...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 6:38 am
JohnDBA (7/8/2011)
I only want to see the records where count of Code >=2 group by GroupID
however, if and only if count of same type >= 2 group...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 8, 2011 at 6:31 am
I don't think so, Jason. Your query returns all rows. You may be misreading his requirements.
John, can you please explain to us why number 7 in...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 7, 2011 at 9:42 pm
koustav_1982 (7/4/2011)
The Dixie Flatline (7/1/2011)
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 7, 2011 at 1:02 pm
WC is right. I'm sorry for using the term 'inline' in such a misleading way.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 4, 2011 at 7:56 pm
Take a look at the OUTPUT clause used in conjunction with an UPDATE to create your temporary table. Why create a trigger? Just put the additional...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 4, 2011 at 6:47 pm
without using cursor and recursive function
Why is this a requirement?
I suggest that you read up on the new hierarchyID datatype in 2008. You can start here.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
July 2, 2011 at 8:59 am
Viewing 15 posts - 1,036 through 1,050 (of 4,080 total)