设置一个别名来区分。
例如在tb_asset和tb_threat中都有asset_id时,要从其中查询出asset_id
select asset_name,important_degree,threat_possibility,influence_degree,a.asset_id as asset_id,threat_id from tb_asset a,tb_threat t where a.asset_id=t.asset_id and project_id=4;
主要就是加一个a.asset_id as asset_id,前面的表名要写成后面的别名,例如在上面的句子中,from tb_asset a,那么前面的表名.asset_id就应该写成a.asset_id