如何使用 ADQL(天文数据查询语言)将多行连接成一行?
我想要做的是选择一个对象的所有替代名称并将它们连接起来,如下所示:
M 13
Hercules cluster
至
M 13, Hercules cluster
我目前在 SIMBAD 上使用的查询(返回同一对象的多行,每个替代名称一个):
-- Basic data from an object given one of its identifiers.
SELECT basic.OID,
RA,
DEC,
main_id AS "Name",
OTYPEDEF.otype_longname AS "Type",
OTYPEDEF.otype_shortname AS "TypeShort",
coo_bibcode AS "Coord Reference",
nbref AS "NbReferences",
plx_value as "Parallax",
rvz_radvel as "Radial velocity",
galdim_majaxis,
galdim_minaxis,
galdim_angle AS "Galaxy ellipse angle",
id1.id
FROM basic JOIN ident ON ident.oidref = oid
LEFT JOIN OTYPEDEF ON OTYPEDEF.otype = basic.otype
LEFT JOIN ident AS id1 ON id1.oidref = basic.OID
WHERE ident.id = 'M13'
在这里试试:http: //simbad.u-strasbg.fr/simbad/sim-tap