<p>You didn't do anything wrong.
The last 10 column names differ only in upper/lower case,
the query generator didn't disambiguate them,
and the error message was inaccurate.</p>
<p>You can fix it by putting the ambiguous column names in quotes.
Omitting the unnecessary table qualifiers:</p>
<pre><code>SELECT TOP 100 RA_ICRS, DE_ICRS, mode, q_mode, class, SDSS12, m_SDSS12,
  objID, &quot;Sp-ID&quot;, ObsDate, Q, umag, e_umag, gmag, e_gmag,
  rmag, e_rmag, imag, e_imag, zmag, e_zmag, zsp, zph,
  e_zph, &quot;&lt;zph&gt;&quot;, e_zsp, &quot;gPmag&quot;, &quot;gpmag&quot;, &quot;ipmag&quot;, &quot;iPmag&quot;, &quot;rpmag&quot;,
  &quot;rPmag&quot;, &quot;upmag&quot;, &quot;uPmag&quot;, &quot;zpmag&quot;, &quot;zPmag&quot;
FROM &quot;V/147/sdss12&quot;
WHERE e_zsp &lt; 0.01 
  AND Q = 3
</code></pre>

CC BY-SA 4.0
2022-07-07T18:10:46.297Z
2022-07-07T18:10:46.297Z
Mike G
<p>I'm trying to query <a href="http://tapvizier.u-strasbg.fr/adql/?%20V/147/sdss12" rel="nofollow noreferrer">http://tapvizier.u-strasbg.fr/adql/?%20V/147/sdss12</a> using the following query, built by clicking <code>Construct your query</code> and <code>Columns and constraints</code>, and then selecting the columns and constraints I want. My goal is to get a <code>csv</code> file of photometric magnitudes and redshift data from SDSS DR12.
 </p>
<pre><code> -- output format : csv
 SELECT TOP 100 &quot;V/147/sdss12&quot;.RA_ICRS,  &quot;V/147/sdss12&quot;.DE_ICRS,  &quot;V/147/sdss12&quot;.mode,  &quot;V/147/sdss12&quot;.q_mode,  &quot;V/147/sdss12&quot;.class,  &quot;V/147/sdss12&quot;.SDSS12,  &quot;V/147/sdss12&quot;.m_SDSS12, 
 &quot;V/147/sdss12&quot;.objID,  &quot;V/147/sdss12&quot;.&quot;Sp-ID&quot;,  &quot;V/147/sdss12&quot;.ObsDate,  &quot;V/147/sdss12&quot;.Q,  &quot;V/147/sdss12&quot;.umag,  &quot;V/147/sdss12&quot;.e_umag,  &quot;V/147/sdss12&quot;.gmag,  &quot;V/147/sdss12&quot;.e_gmag, 
 &quot;V/147/sdss12&quot;.rmag,  &quot;V/147/sdss12&quot;.e_rmag,  &quot;V/147/sdss12&quot;.imag,  &quot;V/147/sdss12&quot;.e_imag,  &quot;V/147/sdss12&quot;.zmag,  &quot;V/147/sdss12&quot;.e_zmag,  &quot;V/147/sdss12&quot;.zsp,  &quot;V/147/sdss12&quot;.zph, 
 &quot;V/147/sdss12&quot;.e_zph,  &quot;V/147/sdss12&quot;.&quot;&lt;zph&gt;&quot;,  &quot;V/147/sdss12&quot;.e_zsp,  &quot;V/147/sdss12&quot;.gPmag,  &quot;V/147/sdss12&quot;.gpmag,  &quot;V/147/sdss12&quot;.ipmag,  &quot;V/147/sdss12&quot;.iPmag,  &quot;V/147/sdss12&quot;.rpmag, 
 &quot;V/147/sdss12&quot;.rPmag,  &quot;V/147/sdss12&quot;.upmag,  &quot;V/147/sdss12&quot;.uPmag,  &quot;V/147/sdss12&quot;.zpmag,  &quot;V/147/sdss12&quot;.zPmag
 FROM &quot;V/147/sdss12&quot;
 WHERE &quot;V/147/sdss12&quot;.e_zsp&lt;0.01 
AND &quot;V/147/sdss12&quot;.Q=3
</code></pre>
<p>but when I press <code>Test</code>, I get the following error message:</p>
<pre><code>adql.db.exception.UnresolvedIdentifiersException: 11 unresolved identifiers: V/147/sdss12 [l.5 c.72 - l.5 c.92], V/147/sdss12 [l.5 c.95 - l.5 c.115], V/147/sdss12 [l.5 c.118 - l.5 c.138], V/147/sdss12 [l.5 c.141 - l.5 c.161], V/147/sdss12 [l.5 c.164 - l.5 c.184], V/147/sdss12 [l.6 c.1 - l.6 c.21], V/147/sdss12 [l.6 c.24 - l.6 c.44], V/147/sdss12 [l.6 c.47 - l.6 c.67], V/147/sdss12 [l.6 c.70 - l.6 c.90], V/147/sdss12 [l.6 c.93 - l.6 c.113]! - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.gPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.gpmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.ipmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.iPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.rpmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.rPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.upmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.uPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.zpmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.zPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - 10 unresolved identifiers: V/147/sdss12 [l.5 c.72 - l.5 c.92], V/147/sdss12 [l.5 c.95 - l.5 c.115], V/147/sdss12 [l.5 c.118 - l.5 c.138], V/147/sdss12 [l.5 c.141 - l.5 c.161], V/147/sdss12 [l.5 c.164 - l.5 c.184], V/147/sdss12 [l.6 c.1 - l.6 c.21], V/147/sdss12 [l.6 c.24 - l.6 c.44], V/147/sdss12 [l.6 c.47 - l.6 c.67], V/147/sdss12 [l.6 c.70 - l.6 c.90], V/147/sdss12 [l.6 c.93 - l.6 c.113]! - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.gPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.gpmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.ipmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.iPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.rpmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.rPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.upmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.uPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.zpmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;. - Ambiguous table reference &quot;&quot;V/147/sdss12&quot;&quot; in &quot;&quot;V/147/sdss12&quot;.zPmag&quot; ! It may come (at least) from &quot;V/147/sdss12&quot; or from &quot;V/147/sdss12&quot;.
</code></pre>
<p>What am I doing wrong here?</p>

CC BY-SA 4.0
2022-07-06T14:05:22.477Z
I used their default query and got "no data in table", so I think the glitch is on their site/side. You may to contact them
Barry Carter
CC BY-SA 4.0
2022-07-06T17:43:25.167Z
If you delete the last 11 fields it works, and returns results.  Must be the last 11 fields don't exist.
Greg Miller
<photometry><sky-survey>
Querying VizieR using SQL interface on their website
Jim421616
# Querying VizieR using SQL interface on their website

(Asked by: username_0 on 2022-07-05)

I'm trying to query http://tapvizier.u-strasbg.fr/adql/?%20V/147/sdss12 using the following query, built by clicking Construct your query and Columns and constraints, and then selecting the columns and constraints I want. My goal is to get a csv file of photometric magnitudes and redshift data from SDSS DR12.
 
 -- output format : csv
 SELECT TOP 100 "V/147/sdss12".RA_ICRS,  "V/147/sdss12".DE_ICRS,  "V/147/sdss12".mode,  "V/147/sdss12".q_mode,  "V/147/sdss12".class,  "V/147/sdss12".SDSS12,  "V/147/sdss12".m_SDSS12, 
 "V/147/sdss12".objID,  "V/147/sdss12"."Sp-ID",  "V/147/sdss12".ObsDate,  "V/147/sdss12".Q,  "V/147/sdss12".umag,  "V/147/sdss12".e_umag,  "V/147/sdss12".gmag,  "V/147/sdss12".e_gmag, 
 "V/147/sdss12".rmag,  "V/147/sdss12".e_rmag,  "V/147/sdss12".imag,  "V/147/sdss12".e_imag,  "V/147/sdss12".zmag,  "V/147/sdss12".e_zmag,  "V/147/sdss12".zsp,  "V/147/sdss12".zph, 
 "V/147/sdss12".e_zph,  "V/147/sdss12"."",  "V/147/sdss12".e_zsp,  "V/147/sdss12".gPmag,  "V/147/sdss12".gpmag,  "V/147/sdss12".ipmag,  "V/147/sdss12".iPmag,  "V/147/sdss12".rpmag, 
 "V/147/sdss12".rPmag,  "V/147/sdss12".upmag,  "V/147/sdss12".uPmag,  "V/147/sdss12".zpmag,  "V/147/sdss12".zPmag
 FROM "V/147/sdss12"
 WHERE "V/147/sdss12".e_zsp<0.01 
AND "V/147/sdss12".Q=3

but when I press Test, I get the following error message:
adql.db.exception.UnresolvedIdentifiersException: 11 unresolved identifiers: V/147/sdss12 [l.5 c.72 - l.5 c.92], V/147/sdss12 [l.5 c.95 - l.5 c.115], V/147/sdss12 [l.5 c.118 - l.5 c.138], V/147/sdss12 [l.5 c.141 - l.5 c.161], V/147/sdss12 [l.5 c.164 - l.5 c.184], V/147/sdss12 [l.6 c.1 - l.6 c.21], V/147/sdss12 [l.6 c.24 - l.6 c.44], V/147/sdss12 [l.6 c.47 - l.6 c.67], V/147/sdss12 [l.6 c.70 - l.6 c.90], V/147/sdss12 [l.6 c.93 - l.6 c.113]! - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".gPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".gpmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".ipmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".iPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".rpmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".rPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".upmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".uPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".zpmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".zPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - 10 unresolved identifiers: V/147/sdss12 [l.5 c.72 - l.5 c.92], V/147/sdss12 [l.5 c.95 - l.5 c.115], V/147/sdss12 [l.5 c.118 - l.5 c.138], V/147/sdss12 [l.5 c.141 - l.5 c.161], V/147/sdss12 [l.5 c.164 - l.5 c.184], V/147/sdss12 [l.6 c.1 - l.6 c.21], V/147/sdss12 [l.6 c.24 - l.6 c.44], V/147/sdss12 [l.6 c.47 - l.6 c.67], V/147/sdss12 [l.6 c.70 - l.6 c.90], V/147/sdss12 [l.6 c.93 - l.6 c.113]! - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".gPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".gpmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".ipmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".iPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".rpmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".rPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".upmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".uPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".zpmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12". - Ambiguous table reference ""V/147/sdss12"" in ""V/147/sdss12".zPmag" ! It may come (at least) from "V/147/sdss12" or from "V/147/sdss12".

What am I doing wrong here?

**Tags:** photometry, sky-survey

> **Comments:**
> **username_1**: I used their default query and got "no data in table", so I think the glitch is on their site/side. You may to contact them  
> **username_2**: If you delete the last 11 fields it works, and returns results.  Must be the last 11 fields don't exist.  

---

## 1 answers

### Answer by username_3 on 2022-07-07. Score: 2 | Accepted answer

You didn't do anything wrong.
The last 10 column names differ only in upper/lower case,
the query generator didn't disambiguate them,
and the error message was inaccurate.
You can fix it by putting the ambiguous column names in quotes.
Omitting the unnecessary table qualifiers:
SELECT TOP 100 RA_ICRS, DE_ICRS, mode, q_mode, class, SDSS12, m_SDSS12,
  objID, "Sp-ID", ObsDate, Q, umag, e_umag, gmag, e_gmag,
  rmag, e_rmag, imag, e_imag, zmag, e_zmag, zsp, zph,
  e_zph, "", e_zsp, "gPmag", "gpmag", "ipmag", "iPmag", "rpmag",
  "rPmag", "upmag", "uPmag", "zpmag", "zPmag"
FROM "V/147/sdss12"
WHERE e_zsp < 0.01 
  AND Q = 3


---

