- SQL code
select COUNT(*),eie_id from today group by eie_id
现在这个表里的eie_id 是英文字符的 在eie_info表里有eie_id 列,有company列,eie_id和company是一一对应的,
我要怎么用一句sql语句查询出得到的是count(*)和company列里面的值呢?而不是直接显示eie_id值?
谢谢大牛帮忙解决,100分!
------解决方案--------------------
- SQL code
select COUNT(*),company from today t join eie_info eon t.eie_id=e.eie_idgroup by company
------解决方案--------------------
- SQL code
select COUNT(1),b.company from today a,eie_info b where a.eie_id=b.eie_idgroup by b.company
------解决方案--------------------
- SQL code
SELECT company , COUNT(*)FROM today a LEFT JOIN eie_info b ON A.eie_id = B.eie_idGROUP BY company