Jochem


with minor changes, I got the query to work.


Thanks everyone for the suggections and help


Rodney

-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 10, 2004 4:21 PM
To: CF-Talk
Subject: Re: SQL Help

Bruce, Rodney S HQISEC/Veridian IT Services wrote:
>  
> Getting this error msg:  with USING
> Server: Msg 155, Level 15, State 1, Procedure sp_ProjectStatusReport, Line
> 58
> 'Proj_id' is not a recognized OPTIMIZER LOCK HINTS option.
>  
> With this query,  using MS SQL 2000
>
> SELECT PROJ_NAME, OC_NAME, PROJ_ID
> FROM #type_data INNER JOIN
>          #status_data USING(Proj_id)
> WHERE #type_data LIKE '%Contr%'
>      and #status_data LIKE '%Engineering%'

Then USING isn't supported by MS SQL Server indeed and we have to
write the full join condition:

SELECT
     T1.proj_id
FROM
     Table T1 INNER JOIN
       Table T2 ON T1.proj_id = T2.proj_id INNER JOIN
       Table T3 ON T2.proj_id = T3.proj_id
WHERE
     T1.Name LIKE '%Open%'
     AND
     T2.Name LIKE '%Engineering%'
     AND
     T3.Name LIKE '%Govt%'

Jochem

--
I don't get it
immigrants don't work
and steal our jobs
     - Loesje
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to