您可以通过联接和聚合来做到这一点:
SELECt t.*, tsum.mycount FROM myTable t join (select orig_id, count(name) as mycount from myTable group by orig_id ) tsum on t.id = tsum.orig_id;

您可以通过联接和聚合来做到这一点:
SELECt t.*, tsum.mycount FROM myTable t join (select orig_id, count(name) as mycount from myTable group by orig_id ) tsum on t.id = tsum.orig_id;