delete a.*
from t_farmerresearchincometb a ,deleted b
     where a.use_tag   = b.use_tag 
     and a.org_code  = b.org_code
     and a.farmer_no = b.farmer_no
------
delete a.*
from t_farmerresearchincometb a 
     inner join deleted b
     on a.use_tag   = b.use_tag 
     and a.org_code  = b.org_code
     and a.farmer_no = b.farmer_no

解决方案 »

  1.   

    是不是如果删除一条语句时用
            delete a.*
              from t_farmerresearchincometb a , 
                   deleted                  b
             where a.use_tag   = b.use_tag 
               and a.org_code  = b.org_code
               and a.farmer_no = b.farmer_no
    如果做删除多条数据的触发器是不是应该时
             delete 
      from t_farmerresearchincometb 
     where use_tag   in (select use_tag   from deleted)
               and org_code  in (select use_tag   from deleted)
       and farmer_no in (select farmer_no from deleted)
      

  2.   

    为什么我的
          delete a.*
              from t_farmerresearchincometb a , 
                   deleted                  b
             where a.use_tag   = b.use_tag 
               and a.org_code  = b.org_code
               and a.farmer_no = b.farmer_no
    提示我的a.* 有错误呢
      

  3.   

    DELETE
    从表中删除行。语法
    DELETE
        [ FROM ]
            { table_name WITH ( < table_hint_limited > [ ...n ] )
             | view_name
             | rowset_function_limited
            }         [ FROM { < table_source > } [ ,...n ] ]    [ WHERE
            { < search_condition >
            | { [ CURRENT OF
                    { { [ GLOBAL ] cursor_name }
                        | cursor_variable_name
                    } 
                ] }
            } 
        ] 
        [ OPTION ( < query_hint > [ ,...n ] ) ]< table_source > ::=
        table_name [ [ AS ] table_alias ] [ WITH ( < table_hint > [ ,...n ] ) ]
        | view_name [ [ AS ] table_alias ]
        | rowset_function [ [ AS ] table_alias ]
        | derived_table [ AS ] table_alias [ ( column_alias [ ,...n ] ) ]
        | < joined_table >< joined_table > ::=
        < table_source > < join_type > < table_source > ON < search_condition >
        | < table_source > CROSS JOIN < table_source >
        | < joined_table >< join_type > ::=
        [ INNER | { { LEFT | RIGHT | FULL } [OUTER] } ]
        [ < join_hint > ]
        JOIN< table_hint_limited > ::=
        { FASTFIRSTROW
            | HOLDLOCK
            | PAGLOCK
            | READCOMMITTED
            | REPEATABLEREAD
            | ROWLOCK
            | SERIALIZABLE
            | TABLOCK
            | TABLOCKX
            | UPDLOCK
        } < table_hint > ::=
        { INDEX ( index_val [ ,...n ] )
            | FASTFIRSTROW
            | HOLDLOCK
            | NOLOCK
            | PAGLOCK
            | READCOMMITTED
            | READPAST
            | READUNCOMMITTED
            | REPEATABLEREAD
            | ROWLOCK
            | SERIALIZABLE
            | TABLOCK
            | TABLOCKX
            | UPDLOCK 
        } < query_hint > ::=
        { { HASH | ORDER } GROUP
            | { CONCAT | HASH | MERGE } UNION
            | FAST number_rows
            | FORCE ORDER
            | MAXDOP
            | ROBUST PLAN
            | KEEP PLAN 
        }