home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.oracle      Overblown overpriced overengineered SHIT      2,288 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,786 of 2,288   
   Feilone Tong to All   
   Re: Update question   
   29 Sep 04 23:28:17   
   
   From: feilone@hotmail.com   
      
   The select clause doesn't return the result as you are expecting.   
   The "ORDER" logic is applied AFTER 10 records is retrieved from MY_TABLE.   
      
   So there is no way to use 1 simple SQL to complete your operation.   
      
   Wing   
      
   "Jul"  ¦b¶l¥ó   
   news:Nr26d.4808$MD5.395214@news20.bellglobal.com ¤¤¼¶¼g...   
   > What wrong with such query:   
   >   
   > update MY_TABLE   
   > set FIELD_ONE = 'A'   
   > where FIELD_TWO in (select FIELD_TWO   
   >                    from MY_TABLE   
   >                    where rownum < 11   
   >                    order by FIELD_THREE )   
   >   
   > The query return such error:   
   > ORA-00907: missing right parenthesis   
   >   
   > I know that the problem because of the "order by" but why?   
   >   
   > And if I need to update only specify portion (for example first 10   
   records)   
   > what to do?   
   > I can use PL/SQL , cursor , but can I do using single query?   
   >   
   > Thanks   
   >   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca