前幾天做了一個網站,爲了測試在數據庫中造了幾個數據,但是怎麼測試怎麼不行,報錯如下:
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關聯到了一起。