前几天做了一个网站,为了测试在数据库中造了几个数据,但是怎么测试怎么不行,报错如下:
No row with the given identifier exists: [com.hisense.jtptmon.mon.entity.BaseRoadSection#1],为了消除脏数据,下面提供两种方法消除脏数据。
1、select * from 表1 t where t.ORG_ID not in (select ORG_ID from 表2);
其中ORG_ID是关联字段。它把表1和表2关联到了一起。
2、第二种方法是采用连接查询。
select * from 表1 a left join 表2 b on a.org_id=b.org_id;
同样的org_id是关联字段,将表1和表2关联到了一起。