从2个表查询数据select id,name,title form tab1 where flag='0'select count(*)as mycount from tab2 where id= 上面从tabl查询出来的id需要同时取出id,name,title 和mycount 值这个关联SQL怎么写??这样写好象不行:select a.id,a.name,a.title,count(*) as mycount from tab1 a,tab2 b where a.id=b.id and a.flag='0'
解决方案 »
- datagrid的问题,选中行变色
- 随机读取
- ASP.NET 页面布局变形
- 网站首页html
- 数据库读取并显示数据的入门小问题,请各位老大帮帮忙!
- “GDI+”中发生一般性错误
- DataGrid中DropDownList,TextBox?????????????
- 在客户端怎么用js得到treeview某个节点的NodeData
- 100分求一个调用google的 WEB server的例子!
- 有无人在 CUSTOMIZED DATAGRID CONTROL 里加入过Template Column
- 急!!新人提问:加RegularExpressionValidator后提交按钮不起作用了??
- DataView中用RowFilter 只查询不重复的记录请问如何写
inner join
(
select count(*) as mycount from tab2 group by id
)
on a.id=b.id
where a.flag='0'
*****************************************************************************
欢迎使用CSDN论坛阅读器 : CSDN Reader(附全部源代码)
http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html