<p>I'm trying to use the SQL search at <a href="https://skyserver.sdss.org/dr18/SearchTools/sql" rel="nofollow noreferrer">https://skyserver.sdss.org/dr18/SearchTools/sql</a> to find (for example) QSOs with accurate redshifts from the SDSS. My query will look something like this:</p>
<pre><code>SELECT TOP 100000
p.ra,p.dec,p.u,p.g,p.r,p.i,p.z,
s.specobjid, s.class, s.z as redshift
FROM PhotoObj AS p
JOIN SpecObj AS s ON s.bestobjid = p.objid
WHERE 
p.e_z &lt; 0.01
</code></pre>
<p>which gives me an error &quot;Invalid column name 'e_z'. How can I find the names of the columns? I can't find them on the SDSS website?</p>

CC BY-SA 4.0
2024-03-18T20:37:37.737Z
Is it the schema browser you want? https://skyserver.sdss.org/dr18/MoreTools/browser  I found the PhotoObj view of the PhotoObjAll table, and it doesn't seem to have an e_z column
James K
CC BY-SA 4.0
2024-03-20T19:57:16.570Z
In SQL the „schema“ is the list of tables and their column names. And you have to consult the schema browser, that is linked from the search page, when you scroll down.
Grimaldi
<star-catalogues><sloan-dss><sdss>
Trying to use SQL to query SDSS
Jim421616
# Trying to use SQL to query SDSS

(Asked by: username_0 on 2024-03-18)

I'm trying to use the SQL search at https://skyserver.sdss.org/dr18/SearchTools/sql to find (for example) QSOs with accurate redshifts from the SDSS. My query will look something like this:
SELECT TOP 100000
p.ra,p.dec,p.u,p.g,p.r,p.i,p.z,
s.specobjid, s.class, s.z as redshift
FROM PhotoObj AS p
JOIN SpecObj AS s ON s.bestobjid = p.objid
WHERE 
p.e_z < 0.01

which gives me an error "Invalid column name 'e_z'. How can I find the names of the columns? I can't find them on the SDSS website?

**Tags:** star-catalogues, sloan-dss, sdss

> **Comments:**
> **username_1**: Is it the schema browser you want? https://skyserver.sdss.org/dr18/MoreTools/browser  I found the PhotoObj view of the PhotoObjAll table, and it doesn't seem to have an e_z column  
> **username_2**: In SQL the „schema“ is the list of tables and their column names. And you have to consult the schema browser, that is linked from the search page, when you scroll down.  

---

## 0 answers

