VizieR ADQL examples

Cone search

the objects from 2mass around M1 within 1 arcmin

SELECT raj2000, dej2000, Jmag, Kmag, Jmag-Kmag as j_k 
   FROM "II/246/out" 
   WHERE 1=CONTAINS(POINT('ICRS', raj2000, dej2000), CIRCLE('ICRS', 83.633083, 22.0145,1/60))

SCone search with constraint

cmc14_distance_from_vega : calculate distance, and print position in GALACTIC from Vega in catalog CMC14

SELECT CMC14,RAJ2000,DEJ2000,POINT('GALACTIC',RAJ2000, DEJ2000),
DISTANCE(POINT('ICRS',279.234734787, 38.783688956), POINT('ICRS',RAJ2000, DEJ2000))
FROM "I/304/out"
WHERE 1=CONTAINS(POINT('ICRS',RAJ2000,DEJ2000), CIRCLE('ICRS', 279.234734787, 38.783688956, 5/60.))

Join tables

Joins between I/259/tyc2 (tycho) and I/239/hip_main (hipparcos) when the indentifiers HIP are equals

SELECT TOP 100 t."RA(ICRS)",  t."DE(ICRS)", t.pmRA,  t.pmDE, t.TYC3, t.TYC2, t.TYC1,
  h.HIP, h.RAICRS, h.DEICRS, h.Plx,  h."B-V" 
   FROM "I/259/tyc2" AS t, "I/239/hip_main" AS h 
   WHERE t.HIP= h.HIP

Crossmatch tables

Crossmatch between wise (WISE) and I/239/hip_main (hipparcos) around the lmc center within 1 deg

SELECT TOP 100 "II/311/wise".RAJ2000,  "II/311/wise".DEJ2000, "I/239/hip_main".HIP,  "I/239/hip_main"."RA(ICRS)", "I/239/hip_main"."DE(ICRS)",  "II/311/wise".WISE 
FROM "II/311/wise", "I/239/hip_main" 
WHERE 1=CONTAINS(POINT('ICRS', "I/239/hip_main".RAICRS, "I/239/hip_main".DEICRS), CIRCLE('ICRS', 80.89417, -69.75611, 1.)) 
AND 1=CONTAINS(POINT('ICRS', "I/239/hip_main".RAICRS, "I/239/hip_main".DEICRS),CIRCLE('ICRS',"II/311/wise".RAJ2000, "II/311/wise".DEJ2000, 10/3600.))

Compute color

YSO catalog (J/A+A/542/A66): return positions, identifiers and magnitudes from c35420066t2 when B_V is less than 2

SELECT TOP 100 Imag,  Jmag,  SAGE,  RAJ2000,  Bmag,  Umag,  DEJ2000, 
Kmag,  Vmag,  Hmag, 
Bmag-Vmag as B_V 
FROM "J/A+A/542/A66/table2" 
WHERE Bmag-Vmag>2

Average values

The proper motions average in catalog PPMX arround the M44 position

SELECT avg(pmDE), avg(pmRA)
FROM "I/312/sample"
WHERE 1=CONTAINS(POINT('ICRS',RAJ2000,DEJ2000), CIRCLE('ICRS', 130.1, 19.6667, 5/60.))

Make a selectionb using advanced constraints

Get records from hipparcos and 2mass catalog with constraints on COLOR (given by 2mass) AND on proper motion (given by hipparcos)

SELECT TOP 100 * 
FROM "II/246/out", "I/239/hip_main" 
WHERE "II/246/out".Jmag-"II/246/out".Hmag < 0.3 AND sqrt("I/239/hip_main".pmRA*"I/239/hip_main".pmRA+"I/239/hip_main".pmDE*"I/239/hip_main".pmDE) > 1 AND 
1=CONTAINS(POINT('ICRS', "I/239/hip_main".RAICRS, "I/239/hip_main".DEICRS),CIRCLE('ICRS',"II/246/out".RAJ2000,"II/246/out".DEJ2000, 5/3600.))

Search object using an identifier

Get the SDSS7 record corresponding to the ObjID='587750952710046398'

SELECT SDSS, m_SDSS, umag, gmag,
       rmag, imag, zmag,
       pmRA, pmDE, RA_ICRS, DE_ICRS, objID
FROM "II/294/sdss7"
WHERE ObjID='587750952710046398'

Get the table description

Search tables containing 'white dwarf' in their description

SELECT  *  FROM tables WHERE description LIKE '%white dwarf%'

Get table details (the columns informations)

Description of I/259/tyc2 table

SELECT * FROM  columns WHERE table_name='I/259/tyc2'

Hipparcos density map

Density map I/239/hip_main table

SELECT ivo_healpix_index(8, RAICRS, DEICRS) AS hpx8, COUNT(*) AS nsrc FROM "I/239/hip_main" GROUP BY hpx8