June 26, 2009 at 3:47 am
Hi Dear,
Please help me.
when i m running this query it displays error.
If someone correct this query then it will very greatful for me.
Thank in advance.
(SELECTdistinct PD.DependentProcessid
FROMProcessDependencies PD
LEFT JOIN Processes P ON
PD.ProcessId=P.ProcessId
INNER JOIN ProcessGroup PG ON
P.ProcessGroupID=PG.ProcessGroupID
ANDPG.OrderID<5
ANDPD.Processid=10
ANDPD.DependencyType='B')as P2
SELECTP1.ProcessID,
CASE WHEN BEGIN P1.Processid=P2.DependentProcessid THEN 1 ELSE 0 END
FROMProcesses P1
June 26, 2009 at 3:55 am
what are you trying to achieve, what is the error message?
MVDBA
June 26, 2009 at 4:02 am
Yes, your query looks very confusing. are trying to write CTE?
like
with P2 as
(SELECT distinct PD.DependentProcessid
FROM ProcessDependencies PD
LEFT JOIN Processes P ON
PD.ProcessId=P.ProcessId
INNER JOIN ProcessGroup PG ON
P.ProcessGroupID=PG.ProcessGroupID
AND PG.OrderID<5
AND PD.Processid=10
AND PD.DependencyType='B')
SELECT P1.ProcessID,
CASE WHEN P1.Processid=P2.DependentProcessid THEN 1 ELSE 0 END
FROM Processes P1
Is this what you are trying to do?
June 26, 2009 at 4:40 am
Thanks u very much dear it's working fine
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply