Viewing 15 posts - 1,456 through 1,470 (of 2,171 total)
Try exists instead
WHERE event_type_id=2 AND version=597 AND tempus.station_id in
(select distinct station_id from events where event_type_id=5)
WHERE event_type_id=2 AND version=597
AND EXISTS (select * from events as p9 where p9.event_type_id=5 and tempus.station_id =...
July 31, 2007 at 1:00 pm
July 31, 2007 at 7:55 am
And if you prefer just one table scan,
SELECT [User],
MAX(CASE WHEN Test = 'PreTst' THEN Grade END) AS PreTst_Grade,
MAX(CASE WHEN Test =...
July 31, 2007 at 7:54 am
For XML Path is avaible first with SQL Server 2005.
July 30, 2007 at 3:48 am
Please, please, please try the algorithm I posted earlier.
It will give you the "starting" category and all children.
July 30, 2007 at 12:51 am
I wonder about the speed for your correlated subquery versus your patented triangular join?
With a larger table than below...
-- Prepare sample data
DECLARE @Sample TABLE (JobNo...
July 29, 2007 at 1:45 pm
Please post expected output, based on previous posted sample data.
July 29, 2007 at 1:42 pm
Okay..
Peter Larsson
Or the signature below my responses? It's the coordinates for my new house!
If someone gets mad at me and want to launch a missile...
July 29, 2007 at 10:55 am
Jeff, don't be sad.
Vamshi hasn't told us how he wants the expected result to be, not formatted.
My code above produces (with small alterations to fit Vamshis envionment) all children with...
July 29, 2007 at 10:39 am
CREATE FUNCTION DBO.FNGETHIERARCHY
(@CategoryID INT)
RETURNS @Peso TABLE (@CategoryID INT, @CategoryName VARCHAR(100), @Depth INT)
AS
BEGIN
DECLARE @Generation INT
July 29, 2007 at 2:53 am
Same question again?
http://www.sqlservercentral.com/forums/shwmessage.aspx?forumid=8&messageid=381713
I think you will be better served if you paid attention to the suggestion you are given, instead of just asking same question again.
July 29, 2007 at 2:45 am
If they are some kind of "suborders", it would be better to number them in sequence and still have "parent order" intact.
This would give you only two levels at any...
July 28, 2007 at 3:00 pm
Is there a maximum depth of levels?
If so, you can write the query with a lot of LEFT JOINs.
It not, no you can't do this with a single query in...
July 28, 2007 at 2:51 am
Viewing 15 posts - 1,456 through 1,470 (of 2,171 total)