//会员表
id userName userPassword
1 u1 u1pwd
2 u2 u2pwd
...//帖子表
id title content userId //将发帖子的用户id保存到这里
1 title1 content1 1
2 title2 content2 1
3 title3 content3 2
4 title4 content4 1
5 title5 content5 2
...
有一个datagrid我想让他显示成这样:
title content userName
title1 content1 u1
title2 content2 u1
title3 content3 u2
title4 content4 u1
title5 content5 u2
...这样的话sql语句怎么写?
id userName userPassword
1 u1 u1pwd
2 u2 u2pwd
...//帖子表
id title content userId //将发帖子的用户id保存到这里
1 title1 content1 1
2 title2 content2 1
3 title3 content3 2
4 title4 content4 1
5 title5 content5 2
...
有一个datagrid我想让他显示成这样:
title content userName
title1 content1 u1
title2 content2 u1
title3 content3 u2
title4 content4 u1
title5 content5 u2
...这样的话sql语句怎么写?
解决方案 »
- 很急的问题
- 母版页 上传附件
- DropdownList中Index问题?
- 急聘ASP.net程序员
- 基于构件的Rich Web应用开发平台AjaxForm终于大功告成!(demo地址:http://www.ourscan.com/ajaxform)
- 谁能告诉我asp.net中的treeview控件为什么不好使啊?
- 立刻结贴:获得DataList模板中的数据模型板中的数据(用<%# DataBinder.Eval()%>绑定的,而没有用到象label,TEXTBOX等服务器控件)
- DropDownList在JavaScript中的使用的一个问题
- 在Doc Net2003上装了vss6.0c,源代码管理器还是不能用,在线等待,急!!!!!!!!!!!!
- 如何删除帖子
- aspx如何连接access数据库?
- 利用GridView控件添加“编辑”按钮,无法提交更新到数据库(新手求助)
FROM dbo.贴子表 INNER JOIN
dbo.会员表 ON dbo.贴子表.userID = dbo.会员表.ID
FROM dbo.贴子表 INNER JOIN dbo.会员表
ON dbo.贴子表.userID = dbo.会员表.ID唉,慢了
============
忙着升星吧,呵呵.
string sqlStr = "select "+myitem+" from [main] a,[users] b where a.User_ID=b.User_ID and [email protected]";