0

我想更新我的数据库中的数据,但我运行我的脚本 Toad 说即使我的条件完全正确,也更新了 0 行。问题是什么?

update CCB.CCB_PRICE_CAT_BALANCE_CAT set end_date =  (
    select  min(start_date) 
    from CCB.CCB_PRICE_CAT_BALANCE_CAT  
    where price_code ='XBG93MCM' 
        and balance_id = 'HS-XSOTHER' group by price_code), 
upd_user='caktas', 
upd_date=sysdate 
where  (price_code ='XBG93MCM' and balance_id = 'HS-XSOTHER') 
    and start_date = (
        select  min(start_date) 
        from CCB.CCB_PRICE_CAT_BALANCE_CAT  
        where price_code ='XBG93MCM' 
            and balance_id = 'HS-XSOTHER' 
        group by price_code);
4

1 回答 1

0

您的查询当前是否与以下内容相同:

update CCB.CCB_PRICE_CAT_BALANCE_CAT
set
    end_date = start_date
    , upd_user='caktas'
    , upd_date=sysdate 
where price_code ='XBG93MCM'
and balance_id = 'HS-XSOTHER'
and start_date = (
    select
        min(start_date) 
    from CCB.CCB_PRICE_CAT_BALANCE_CAT  
    where price_code ='XBG93MCM' 
    and balance_id = 'HS-XSOTHER' 

);

如果是这样,您可以检查 的值min(start_date)吗?

于 2013-06-19T13:21:53.020 回答