Posted by Dave Smithz on 01/24/06 02:12
"Bill Karwin" <bill@karwin.com> wrote in message
news:dr3m4s02n9a@enews4.newsguy.com...
> Fetch the list of student_id values, and format the list as a string with
> values comma-separated.
> Then create an UPDATE statement including that string:
>
> UPDATE students
> SET status = ...value...
> WHERE student_id IN ( ...comma-separated list of values from previous
> query... )
OK, thanks for this. This is the method I went for in the end. Therefore
writing a PHP script to run a query to get all the ID's I needed to update
and then running a second query. I think I was trying to hard to do this in
a single SQL statement without subqueries.
I just assumed it would be possible to do conditional updates based on
values when grouping, but I guess it is more complicated then that.
Thanks for all the input.
Kind regards
Dave
[Back to original message]
|