Jump to content

Operation must use an updatable query

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Gerg? Magyar

Gerg? Magyar

    Newbie

  • Members
  • PipPip
  • 22 posts

[COLOR="#0000FF"]UPDATE[/COLOR] dialy_report 

[COLOR="#0000FF"]SET [/COLOR]

 Pizza24 = Pizza24+([COLOR="#0000FF"]SELECT SUM[/COLOR](piece) [COLOR="#0000FF"]AS[/COLOR] Pizza24 [COLOR="#0000FF"]FROM[/COLOR] report [COLOR="#0000FF"]WHERE[/COLOR] [COLOR="#0000FF"]Mid[/COLOR](name,1,2)=[COLOR="#8B4513"]"24"[/COLOR]) , 

 Pizza36 = Pizza36+([COLOR="#0000FF"]SELECT SUM[/COLOR](piece) [COLOR="#0000FF"]AS[/COLOR] Pizza36 [COLOR="#0000FF"]FROM[/COLOR] report [COLOR="#0000FF"]WHERE[/COLOR] [COLOR="#0000FF"]Mid[/COLOR](name,1,2)=[COLOR="#8B4513"]"36"[/COLOR]) , 

 Pizza50 = Pizza50+([COLOR="#0000FF"]SELECT SUM[/COLOR](piece) [COLOR="#0000FF"]AS[/COLOR] Pizza50 [COLOR="#0000FF"]FROM[/COLOR] report [COLOR="#0000FF"]WHERE[/COLOR] [COLOR="#0000FF"]Mid[/COLOR](name,1,2)=[COLOR="#8B4513"]"50"[/COLOR]) ;


I'm tried:

[COLOR="#0000FF"]UPDATE[/COLOR] dialy_report 

[COLOR="#0000FF"]SET [/COLOR]

 Pizza24 = Pizza24+([COLOR="#0000FF"]SELECT SUM[/COLOR](piece) [COLOR="#0000FF"]AS[/COLOR] Pizza24 [COLOR="#0000FF"]FROM[/COLOR] report [COLOR="#0000FF"]WHERE[/COLOR] [COLOR="#0000FF"]Mid[/COLOR](name,1,2)=[COLOR="#8B4513"]"24"[/COLOR]) , 

 Pizza36 = Pizza36+([COLOR="#0000FF"]SELECT SUM[/COLOR](piece) [COLOR="#0000FF"]AS[/COLOR] Pizza36 [COLOR="#0000FF"]FROM[/COLOR] report [COLOR="#0000FF"]WHERE[/COLOR] [COLOR="#0000FF"]Mid[/COLOR](name,1,2)=[COLOR="#8B4513"]"36"[/COLOR]) , 

 Pizza50 = Pizza50+([COLOR="#0000FF"]SELECT SUM[/COLOR](piece) [COLOR="#0000FF"]AS[/COLOR] Pizza50 [COLOR="#0000FF"]FROM[/COLOR] report [COLOR="#0000FF"]WHERE[/COLOR] [COLOR="#0000FF"]Mid[/COLOR](name,1,2)=[COLOR="#8B4513"]"50"[/COLOR]) 

[COLOR="#0000FF"]WHERE[/COLOR]

 Pizza24 = Pizza24 [COLOR="#0000FF"]AND[/COLOR] Pizza36 = Pizza36 [COLOR="#0000FF"]AND[/COLOR] Pizza50 = Pizza50;


Edited by Gerg? Magyar, 23 December 2011 - 05:58 AM.


#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Do it as three update statements.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
Gerg? Magyar

Gerg? Magyar

    Newbie

  • Members
  • PipPip
  • 22 posts
I tried one at a time.

Edited by Gerg? Magyar, 23 December 2011 - 07:28 AM.


#4
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
  • Location:Upstate, South Carolina
  • Programming Language:C, C++, PL/SQL, Delphi/Object Pascal, Pascal, Transact-SQL, Others
  • Learning:Java, C#, PHP, JavaScript, Lisp, Fortran, Haskell, Others
Maybe if you can explain what your data is, and what you're trying to accomplish....
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users