group by 。。。
select t2.*,t3.ncount from(select groupid, count(id) as ncount from t_txlEmploy group by groupid) t3, t_txlgroup t2
where t2.id=t3.groupid(+)
group by t2.id,t3.groupid
構架一張t3表,字段為“集團編號”,“集團用戶數”
然后用“集團表”和t3表再關聯
posted on 2009-04-22 16:37 秋楓故事 閱讀(237) 評論(0) 編輯 收藏 所屬分類: 工作總結