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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 error in update join query---urgent help required

Author  Topic 

katari.kathyayani
Starting Member

1 Post

Posted - 2008-05-31 : 04:56:54
Hi,

When I used the below, I am getting an error saying sql command not properly ended and 'from' is highlighted

UPDATE avd SET tphd_indctr = '' FROM ka31dvma.dvim_used_vehicle duv, addtl_veh_data avd INNER JOIN addtl_veh_data avd ON avd.veh_ident_nbr = duv.veh_ident_nbr WHERE duv.business_associate_cd = '81037'

And in need to add one more condition, "where a.VEH_IDENT_NBR not in ('1G1YY32G545106114')"

Please correct this query

Thanks,
Kathyayani

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-05-31 : 09:06:31
You have listed the [addtl_veh_data] table twice


UPDATE avd SET
tphd_indctr = ''
FROM ka31dvma.dvim_used_vehicle duv --, addtl_veh_data avd
INNER JOIN addtl_veh_data avd
ON avd.veh_ident_nbr = duv.veh_ident_nbr
WHERE duv.business_associate_cd = '81037'
AND avd.VEH_IDENT_NBR not in ('1G1YY32G545106114')


Be One with the Optimizer
TG
Go to Top of Page
   

- Advertisement -