Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2012
    Posts
    2

    Unanswered: Select works, update does not

    When we do a select statement i.e...
    select * from gjob where jobcode < '229340A13'
    we get 1600 records but when we do an update:
    update gjob set jactive = 'N' where jobcode < '229340A13'
    this returns the error: subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <,.....

    What is wrong? I can do this update with a smaller subset and one record at a time.
    Last edited by zuchinni; 04-13-12 at 14:48.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by zuchinni View Post
    ... but when we do an update:
    update gjob set jactive = 'N' jobcode < '229340A13'
    syntax error, missing WHERE keyword
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Apr 2012
    Posts
    2
    Sorry - not missing the where in the update. That was a typo. That is not the issue.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    okay, then, on to my next observation...

    error "subquery returned more than 1 value" not believable because there's no subquery
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I'll agree with r937, you haven't posted the code that is causing your problem or problems.

    -PatP
    In theory, theory and practice are identical. In practice, theory and practice are unrelated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •