Web Development Thread, SQL Insert Query in Coding and Web Development; 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)
...
-
8th September 2008, 03:33 PM #1
- Rep Power
- 10
SQL Insert Query
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!
-
-
9th September 2008, 03:42 PM #2
- Rep Power
- 0
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.
-
SHARE:
Similar Threads
-
By DirtySnipe in forum EduGeek Joomla 1.5 Package
Replies: 5
Last Post: 25th June 2008, 08:36 PM
-
By stu in forum How do you do....it?
Replies: 4
Last Post: 1st April 2008, 11:47 AM
-
By flashsnaps in forum Windows
Replies: 6
Last Post: 31st January 2008, 10:05 AM
-
By markwilliamson2001 in forum Web Development
Replies: 5
Last Post: 5th October 2007, 08:43 AM
-
By Kained in forum Web Development
Replies: 10
Last Post: 25th July 2007, 02:56 AM
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules