select id,times=count(*)
from table1 a,table2 b
where charindex(','+a.id+',',','+b.name+',')>0
group by id
from table1 a,table2 b
where charindex(','+a.id+',',','+b.name+',')>0
group by id
解决方案 »
- 内置行id问题
- SQL查询问题
- 小问题
- 请各位帮我指点关于inner join,full outer join,left join,right jion的具体实现含义.
- Sql Server 2005数据库被标记为“可疑”问题
- 求做报表思路——通过配置excel 就能查询sql 2005
- 求助sql server语句
- 如何写这个函数作统计?有点类似group by
- 有那位大虾前辈知道如何把网页和数据库关联。
- 一个典型数据算法问题求解,高手请出手!
- 关于timestamp数据类型的问题!!!!!
- 哪里能够找到dos6.22下直接编程连接sql2000的技术资料?(不用set dsquery= ...)
select a.id, count(*) as times
from table1 a , table2 b
where charindex(','+a.id+',' , ','+b.name+',')>0
select a.id, count(*) as times
from table1 a , table2 b
where charindex(','+a.id+',' , ','+b.name+',')>0
group by a.id
为什么a.id前后要加','+呢,不加
不是也可以实现吗
谢高手赐教