+ Post New Thread
Results 1 to 2 of 2
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) ...
  1. #1

    Join Date
    May 2008
    Location
    Cheshire
    Posts
    289
    Thank Post
    48
    Thanked 27 Times in 24 Posts
    Rep Power
    18

    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!

  2. #2

    Join Date
    Sep 2008
    Location
    Edinburgh
    Posts
    12
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    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:
+ Post New Thread

Similar Threads

  1. How to insert / embed movie files
    By DirtySnipe in forum EduGeek Joomla 1.5 Package
    Replies: 5
    Last Post: 25th June 2008, 08:36 PM
  2. How do you insert a formulae on open office
    By stu in forum How do you do....it?
    Replies: 4
    Last Post: 1st April 2008, 11:47 AM
  3. PC Reboots upon insert cat5 cable
    By flashsnaps in forum Windows
    Replies: 6
    Last Post: 31st January 2008, 09:05 AM
  4. Query of existing query data in PHP
    By markwilliamson2001 in forum Web Development
    Replies: 5
    Last Post: 5th October 2007, 08:43 AM
  5. SQL Query :S
    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
  •