Reply to Re: Update query needed - on a "group by" query - Possible / How???

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация