look for this line in include/staff/tickets.inc.php ~ line 141
$sortOptions=array('date'=>'ticket.created','ID'=> 'ticketID','pri'=>'priority_urgency','dept'=>'dept_name', 'ass'=>'username', 'from' => 'name', 'subject' => 'subject', 'updated' => 'updated');
there was a space in mine at 'dept'=>'dept _name' just like i can see in your mysql error there is one in yours as well.