Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 inner join not working

Author  Topic 

tariq2
Posting Yak Master

125 Posts

Posted - 2011-04-06 : 09:27:03


Hi, when running the following query:

(select * from openquery(symprod_etldev,'select * from proddta.f0902 where gbmcu = '' 0802378701''
and gblt = ''HA'' '))a
INNER JOIN D_Accounts b on a.gbobj = b.l5account

I receive the following error:
Msg 102, Level 15, State 1, Line 4
Incorrect syntax near 'a'.

Many thanks for your help

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2011-04-06 : 09:32:51
If you have a derived table like
(select ...)a

then you need to use it like
select * from (select ...)a


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

tariq2
Posting Yak Master

125 Posts

Posted - 2011-04-06 : 12:12:09
Thank you Fred, very helpful
Go to Top of Page
   

- Advertisement -