Jump to content

Recommended Posts

Posted

Hey all,

 

I'm using MSSQL, and came up with this query to display the results I want.

select tutorgroup_name, count(borrower_tutorgroup_id)

from WBLS.dbo.Borrower left outer join WBLS.dbo.tutorgroup on

borrower_tutorgroup_id=tutorgroup_id

group by borrower_tutorgroup_id, tutorgroup_name

 

It shows the number of tutor group names (e.g. 7x, 8x...) and then the number of pupils in the specific group.

 

How do I modify the select statement so it will update a field called tutorgroup_total for each different tutor group with the count of number of pupils in the specific group.

 

Hope this makes sense... I have a headache lol

 

Thanks!

Posted

You want to run the update and the select in the same statement and still return the recordset? I don't think you can without a stored procedure. Why not just run the update statement after the select.

 

HTH.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...