asp中的sql可否用in
asp中操作access的sql语句能否用这样的语句
select * from table1 where id in (select stext from table2)
其中stext是备注字段,储存的数据是诸如1,2,5,8,11这样的数据,
我直接
select * from table1 where id in (1,2,5,8,11)就可以,如果按开始的写法就不对,必须两次操作,先读出stext再操作。
问题点数:50、回复次数:7Top
1 楼skangming(Wii...)回复于 2006-03-09 14:00:10 得分 0
可以啊Top
2 楼bluesun()回复于 2006-03-09 14:02:17 得分 0
select * from table1 where id in (select stext from table2 where=1)通不过。Top
3 楼batistuta97()回复于 2006-03-09 14:16:18 得分 0
select * from table1 where id in (select stext from table2 where=1)
where=1???
select * from table1 where id in (select stext from table2)
这种是可以的
放到SQL server里面执行一下,看看有什么结果Top
4 楼yiyioo(天一(一个人的Team))回复于 2006-03-09 14:21:49 得分 25
备注字段好象是不行的~``````Top
5 楼bluesun()回复于 2006-03-09 14:25:16 得分 0
select * from table1 where id in (select stext from table2 where id=1)Top
6 楼skangming(Wii...)回复于 2006-03-09 14:31:24 得分 0
stext是什么类型?Top
7 楼skangming(Wii...)回复于 2006-03-09 14:31:57 得分 25
就象楼上说的,备注字段应该是不行的Top




