最近用PostgresSql数据库进行多表关联删除的操作,在写sql语句的时候遇到了问题:DELETE s.* FROM student s,classroom c WHERE s.cid = c.id AND s.sid = 1DELETE FROM student s,classroom c WHERE s.cid = c.id AND s.sid = 1上面两种写法操作后..
t_aj_ajjbxxt_aj_ajfbxxt_xt_dwxx两表关联,删除一张表中数据delete from db_lx.t_aj_ajfbxx ajfbUSING db_lx.t_xt_dwxx dw where dw.c_bh=ajfb.c_ssdw and dw.c_sfbh='65';只有t_aj_ajfbxx 表中数据被删除三表关联,删除一张表中数据delete from d..
以下为测试例子。 1.首先创建两张临时表并录入测试数据: 复制代码 代码如下: create table #temptest1 ( id int, name1 varchar(50), age int ) create table #temptest2 ( id int, name1 varchar(50), age int )查询出此时的表数据为:#temptest1..
类似如下: select A.key,B.key,C.key from A,B,C where trim(A.key)=trim(B.fk) and trim(A.col)=trim(C.pk)。 在主表A(200多条记录)关联附表B(4万多条记录)时用了1秒钟时间,该值在不同机器执行可能有所差异,但比不加trim速度稍微慢一些,但是..