表1: xschu //销售记录表
字段: xs_id cpcom_id //xs_id编号 cpcom_id 公司ID
1 4
2 1
3 8
4 4
5 6表2: temp //临时表
字段: xs_id // xs_id 是从xschu表中筛选出的xs_id
2
4
3表3: cpcom //公司信息表
字段: cpcom_id cpcom_name //cpcom_id 是公司ID cpcom_name 是公司名字
1 中国
2 英国
3 法国
4 美国
5 日本
6 韩国
7 利拉克
8 X国
9 Y国
10 Z国
怎么通过temp表得到结果 求sql语句
1 中国
4 美国
8 X国
谢谢大家了
字段: xs_id cpcom_id //xs_id编号 cpcom_id 公司ID
1 4
2 1
3 8
4 4
5 6表2: temp //临时表
字段: xs_id // xs_id 是从xschu表中筛选出的xs_id
2
4
3表3: cpcom //公司信息表
字段: cpcom_id cpcom_name //cpcom_id 是公司ID cpcom_name 是公司名字
1 中国
2 英国
3 法国
4 美国
5 日本
6 韩国
7 利拉克
8 X国
9 Y国
10 Z国
怎么通过temp表得到结果 求sql语句
1 中国
4 美国
8 X国
谢谢大家了
解决方案 »
- 绑定数据库后的dropdownlist的switch无法正常使用
- TextBox DropDownList CheckBox Gridview
- 关于绑定的一个问题
- 紧急求助!程序进行过程中删除页面显示过的图片提示图片有人在用,不能删除!!
- 请教,使用input checkbox如何实现批量删除
- .net类库和MFC一样包封装了win API吗?
- 关于 ASP.NET MVC FILTER的问题
- 在模板列中,定义了一个textbox(id=tbox),怎么能使用它呢?
- 什么是水晶报表?有什么用?怎么用?去哪里下载?
- 能把datagrid的内容导入到word中吗
- 因为.net出问题,不能调试了,维护时安装了一下,还是不能成功,出现错误
- 在asp.netC#怎么用才能防SQl注入那.
FROM cpcom
WHERE (cpcom_id IN
(SELECT xschu.cpcom_id
FROM xschu INNER JOIN
temp ON xschu.xs_id = temp.xs_id))
我运行过了可以得到结果
in (select cpcom_id from temp inner join xschu on xschu.xs_id =temp.xs_id)
order by cpcom_id
in (select cpcom_id from temp inner join xschu on xschu.xs_id =temp.xs_id)
order by cpcom_idORselect cpcom.cpcom_id,cpcom.cpcom_name from cpcom join xschu on cpcom.cpcom_id = xschu.cpcom_id join temp on xschu.xs_id = temp.xs_id