如何解决错误:SQL中无法绑定多部分标识符“ p.ra”

MNK

我正在使用以下SQL代码从S中提取数据

select
   round(p.ra,6) as ra, round(p.dec,6) as dec,
   p.run, 
   round(p.extinction_r,3) as rExtSFD, 
   round(p.modelMag_u,3) as uRaw, 
   round(p.modelMag_g,3) as gRaw, 
   round(p.modelMag_r,3) as rRaw,
   round(p.modelMag_i,3) as iRaw,
   round(p.modelMag_z,3) as zRaw,
   round(p.modelMagErr_u,3) as uErr, 
   round(p.modelMagErr_g,3) as gErr,
   round(p.modelMagErr_r,3) as rErr,
   round(p.modelMagErr_i,3) as iErr,
   round(p.modelMagErr_z,3) as zErr,
   round(p.psfMag_u,3) as uRawPSF, 
   round(p.psfMag_g,3) as gRawPSF,
   round(p.psfMag_r,3) as rRawPSF,
   round(p.psfMag_i,3) as iRawPSF,
   round(p.psfMag_z,3) as zRawPSF,
   round(p.psfMagErr_u,3) as upsfErr,
   round(p.psfMagErr_g,3) as gpsfErr,
   round(p.psfMagErr_r,3) as rpsfErr,
   round(p.psfMagErr_i,3) as ipsfErr,
   round(p.psfMagErr_z,3) as zpsfErr, p.type,
   (case when (p.flags & '16') = 0 then 1 else 0 end) as ISOLATED 

from
   photoObjAll
into
   mydb.SDSSimagingSample
where
   p.ra > 0.0 and p.ra < 10.0
   and p.dec > -1 and p.dec < 1
   and (p.type = 3 OR p.type = 6)
   and (p.flags & '4295229440') = 0
   and p.mode = 1
   and p.modelMag_r < 22.5

我收到以下错误:

The multi-part identifier "p.ra" could not be bound. The multi-part 
identifier "p.ra" could not be bound. The multi-part identifier "p.dec" 
could . . . . . . . . . .  
not be bound. 

我是SQL的新手,不知道如何克服这个问题。有关SDSS数据访问的信息可以在以下位置找到:http : //skyserver.sdss.org/CasJobs/Guide.aspx

vvvv4d

您正在使用“ p”。在您的select语句中的几列上都使用了别名,但是您的表没有别名为“ p”。

您需要将其更改为

from
photoObjAll as p

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章