Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2004
    Location
    Manchester, UK
    Posts
    143

    Unanswered: Ingres 2006 Update Error

    Hi all,

    I am attempting to run an update statement in Ingres 2006 to update a number of records. When I run the nested select I get 150 records, but when I run the update it changes 5600 records!!! Can anyone spot where I am going wrong with this command. I just can't see how it can be updating more than I ask it to.

    Code:
    update hbincome                                                            
         set inc_type = ''                                                          
         where claim_id in (select a.claim_id                                       
         from hbhousehold a, hbincome b                                             
         where a.claim_id = b.claim_id                                              
         and a.house_id = b.house_id                                                
         and a.to_date = '31.12.2099'                                               
         and b.inc_code in ('IBH','IBN','IBL','DLL','DLA','DLH')                    
         and b.inc_type in ('18','19','HL','HR'));
    Many thanks,
    Paula

  2. #2
    Join Date
    Jul 2009
    Posts
    4
    I Polly013,

    try a select distinct, because if the select returns duplicated rows, it may have this behavior.

    update hbincome
    set inc_type = ''
    where claim_id in (select distinct a.claim_id
    from hbhousehold a, hbincome b
    where a.claim_id = b.claim_id
    and a.house_id = b.house_id
    and a.to_date = '31.12.2099'
    and b.inc_code in ('IBH','IBN','IBL','DLL','DLA','DLH')
    and b.inc_type in ('18','19','HL','HR'));

Posting Permissions

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