My query is following this
select drivers.Author
from timesheet
join drivers
on drivers.BibNum = timesheet.BibNum
group by drivers.Author
order by count(timesheet.BibNum) desc
limit 1;
But I got this error,
Error while compiling statement: FAILED: SemanticException [Error 10004]: Line 1:126 Invalid table alias or column reference 'timesheet': (possible column names are: author)
My table looks like this
Drivers
+-----------------+-----------------+-----------------+--+
| bibnum | string | from deserializer |
| title | string | from deserializer |
| author | string | from deserializer |
| isbn | string | from deserializer |
| publicationyear | string | from deserializer |
| publisher | string | from deserializer |
| subjects | string | from deserializer |
| itemtype | string | from deserializer |
| itemcollection | string | from deserializer |
| floatingitem | string | from deserializer |
| itemlocation | string | from deserializer |
| reportdate | string | from deserializer |
| itemcount | string | from deserializer |
+-----------------+-----------------+-----------------+--+
timesheet
+-----------------+-----------------+-----------------+--+
| bibnum | string | from deserializer |
| itembarcode | string | from deserializer |
| itemtype | string | from deserializer |
| itemcollection | string | from deserializer |
| callnumber | string | from deserializer |
| checkoutdatetime | string | from deserializer |
+-----------------+-----------------+-----------------+--+
If you know the reason, please enlighten me and thank you for your help. If you need more information to my schema, let me know.