Re: need help for a update command
Posted in 2003
Malcolm Garbett wrote: > Hello, > > I was going to ask a similar question, so if I may join in... > > <SNIP> > > So...I tried this > > update salesorders > set sostate = "COMP" > where sostate = "NEW" > and sdate < "01/04/2000" > and son = > > (select unique sona from salesitems where soitemstate = "DONE" > and sduedate < "01/04/2000"); > > > This fails because of 284: A subquery has returned not exactly one row. > > Any help in pointing out the error of my ways greatly appreciated. You are not joining the subquery to the update table. See Jonathan's reply for an example. Cheers, -- Mark. +----------------------------------------------------------+-----------+ | Mark D. Stock mailto:mdstock@MydasSolutions.com |//////// /| | Mydas Solutions Ltd http://MydasSolutions.com |///// / //| | +-----------------------------------+//// / ///| | |We value your comments, which have |/// / ////| | |been recorded and automatically |// / /////| | |emailed back to us for our records.|/ ////////| +----------------------+-----------------------------------+-----------+