szhswl
宋针还的个人空间
UPDATE SA.SUBMIT SA
   SET SEND_STATE = (SELECT SEND_STATE
                       FROM PHS.SUBMIT
                      WHERE PHS.SUBMIT.ID = SA.ID
                        AND SUBSTR(SA.SEND_STATE, 15, 1) <>
                            AN.SUBMIT.SEND_STATE
                        AND SUBSTR(SA.SEND_STATE, 15, 1) IS NOT NULL)
 WHERE SA.ISCHGSTATUS = 0 AND EXISTS
 (SELECT 1
          FROM PHS.SUBMIT PHS
         WHERE PHS.ID = SA.ID
           AND SUBSTR(SA.SEND_STATE, 15, 1) <> PHS.SEND_STATE
           AND SUBSTR(SA.SEND_STATE, 15, 1) IS NOT NULL)

SQL说明:更新sa用户的submit表,与an用户的submit表相同字段但值不相同的数据。

---------------------------------------------------------------------------------------------------------------------------------
说人之短,乃护己之短。夸己之长,乃忌人之长。皆由存心不厚,识量太狭耳。能去此弊,可以进德,可以远怨。
http://www.blogjava.net/szhswl
------------------------------------------------------------------------------------------------------ ----------------- ---------
posted on 2007-12-03 17:22 宋针还 阅读(462) 评论(0)  编辑  收藏 所属分类: SQL

只有注册用户登录后才能发表评论。


网站导航: