I have a situation where I need to count the number of records (Lines) for each job number in the jobtable. I have the following select script which does this.
Select job, COUNT (*) AS 'Lines'
FROM jobtable
GROUP BY job
Job Lines
--------- --------
1 26
2 12
3 46
...
Now I would like to update a second table "materials" using the result of the count in a column called 'time'. So in the table called materials where the job = 1 update time = 26, where job is = 2 update the time = 12 etc ......