You are here: Re: Please Help With Complex Update Statement Logic « MsSQL Server « IT news, forums, messages
Re: Please Help With Complex Update Statement Logic

Posted by pbd22 on 11/10/06 14:40

well, i'll keep an eye open for future problems, but right now the
statement is working fine.
taken from the server command statement, the final result is as follows
and seems to work:

update addlist set add_status = 1 where add_id in (select add_id from
addlist a, editprofile e where a.email_address = e.email_address and
e.public_name = '" + Request.Params.Get("pubname") + "' and a.add_email
= '" + Context.User.Identity.Name + "')

Erland:

thanks. that is what i thought. when any action taken on the client is
likely to produce a boolean result, storing the logic as a bit value
makes perfect sense to me. i am not sure
why the other fellow was so against it.

othellomy@yahoo.com wrote:
> I was wondering if multiple updates are happening that is overwriting
> previous updates. The table in the where clause has '...in (some
> values)...' If '...in (some values)...' are hit twice then the latest
> value will overwrite other updates. I hope this makes sense.
>
> pbd22 wrote:
> > hi.
> >
> > I am having probelms with an update statement. every time
> > i run it, "every" row updates, not just the one(s) intended.
> >
> > so, here is what i have. i have tried this with both AND and OR
> > and neither seem to work.
> >
> > i dont know why this is elluding me, but i'd appreciate help with the
> > solution.
> >
> > thanks.
> >
> > UPDATE add
> > SET add_s = 1
> > WHERE add.add_status = 0 and add.add_email = 'mags23@rice.edu'
> > or add_s in
> > (
> > SELECT a.add_s
> > FROM add a, edit e
> > WHERE a.email_address = e.email_address
> > and e.public_name = 'professor'
> > )

 

Navigation:

[Reply to this 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

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