mysql数据库中查询一个字段相同,另一个字段不相同的数据的数据
如查询所有跨律所的律师数据:SELECT DISTINCT x.lawyer_id,x.lawfirm_id FROM
answer as x,
answer as y WHERE x.id<1000 and x.lawyer_id=y.lawyer_id and x.lawfirm_id!=y.lawfirm_id
注:性能有限,大数据量不建议使用
如查询所有跨律所的律师数据:SELECT DISTINCT x.lawyer_id,x.lawfirm_id FROM
answer as x,
answer as y WHERE x.id<1000 and x.lawyer_id=y.lawyer_id and x.lawfirm_id!=y.lawfirm_id
注:性能有限,大数据量不建议使用