I have a table `ticketdetails` which contains a column with data that I want to copy to another table's column:

```
SELECT TicketID, MIN( StartTime ) StartTime
FROM ticketdetails
GROUP BY TicketID #might be unnecessary?
ORDER BY TicketID

```

The output looks like this:

![enter image description here](https://i.stack.imgur.com/nECDo.png)

I want the result of this query, "StartTime", to be supplied in my other table column, `tickets.TimeScheduled`, where the `TicketID` matches for both tables.

Right now I'm trying:

```
UPDATE tickets SET TimeScheduled = (
SELECT MIN( StartTime ) StartTime
FROM ticketdetails
GROUP BY TicketID
ORDER BY TicketID)
WHERE tickets.TicketID = ticketdetails.TicketID

```

I get this error: 

```
#1054 - Unknown column 'ticketdetails.TicketID' in 'where clause'

```

I know that this column exists in my database. For some reason the query doesn't recognize the column. I think I need a `JOIN` or something, but I'm not the best with intermediate-advanced MySQL queries. Help is much appreciated.