# Listing within tabular — alignment

I have the following code where $q_1$ aligns in the middle. I would like to align it with the top line (SELECT). Is there a way to do that?

\documentclass{article}
\usepackage{listings}

\lstset{language=SQL}

\begin{document}
\begin{tabular}{ll}
$q_{1}:$ & \begin{lstlisting}
SELECT EMP.ENAME
FROM   EMP NATURAL JOIN ASG NATURAL JOIN PROJ
\end{lstlisting}
\end{tabular}
\end{document}


With the boxpos=t option you can achieve the desired alignment:

\documentclass{article}
\usepackage{listings}

\lstset{language=SQL}

\begin{document}
\begin{tabular}{ll}
$q_{1}:$ & \begin{lstlisting}[boxpos=t]
SELECT EMP.ENAME
FROM   EMP NATURAL JOIN ASG NATURAL JOIN PROJ

From the listings documentation:
boxpos=〈b|c|t〉: Sometimes the listingspackage puts a \hbox around a listing— or it couldn’t be printed or even processed correctly. The key determines the vertical alignment to the surrounding material: bottom baseline, centered or topbaseline. [...]
The default alignment is, as you observed c.