---【关于sql的简单问题】---

wooernet 2003-07-28 01:01:46
1、在asp中,能用嵌套的sql查询吗?请举例说明。(我以前试过,但没成功。)

select * from table2 where firstid in (select id from table1 where name like '刘%')
如果上边的select可以的话,再如果查到2条信息,在asp中怎么让2条信息都显示出来?

2、在asp中,多表链接查询会很慢吗?
...全文
22 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
conner 2003-07-28
  • 打赏
  • 举报
回复
你的这种方法是不对的,因为in语句是需要有“,”号分割的
select * from table2 where firstid in (select id from table1 where name like '刘%')

要实现你的目的,方法很多,但是比较接近你的想法的可以使用这个语句
select * from table2 a,(select id from table1 where name like '刘%') b where a.firstid=b.id
earthpea 2003-07-28
  • 打赏
  • 举报
回复
1、可以
你就用rs(0)、rs(1)或者rs("name")、rs("group")显示不就行了?还有什么吗?

2、这要看你的sql编写的好坏了,与asp无关的,在asp中使用多表查询和直接在sql server中使用,速度是没有什么分别的(除了整理显示的时间)
Primer2002cn 2003-07-28
  • 打赏
  • 举报
回复
1.可以
"如果上边的select可以的话,再如果查到2条信息,在asp中怎么让2条信息都显示出来?"
不懂!
2.速度一般不会慢
pp4u 2003-07-28
  • 打赏
  • 举报
回复
可以
AngelGavin 2003-07-28
  • 打赏
  • 举报
回复
1。能

2。不知道

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧