请帮我写一个搜索的东东

hencai 2003-11-09 09:45:05
表一:ID int,标题int,内容text
表二:ID int,标题int,内容text
表三:ID int,标题int,内容text
表四:ID int,标题int,内容text
………

请问怎样用asp把这若干表做成如下

搜索“按标题”,把表一、表二…等等的标题列的内容全部搜索出来。并且15条记录分页。
搜索“按内容”,把表一、表二…等等的内容列的内容全部搜索出来。并且15条记录分页。
...全文
66 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
hencai 2003-11-11
  • 打赏
  • 举报
回复
多谢,顺便问一下,怎么给分?
Ouyangyifeiczy 2003-11-09
  • 打赏
  • 举报
回复
-- try using "union all"
select * from
(
select * from t1
union all
select * from t2
union all
select * from t3
....
union all
select * from tn
) a where 标题=10

select * from
(
select * from t1
union all
select * from t2
union all
select * from t3
....
union all
select * from tn
) a where 内容 like '%aaa%'

在ASP中用rs.rowspage分页,自己控制.具体参考ADO中记录集帮助.
gmlxf 2003-11-09
  • 打赏
  • 举报
回复
-- try using "union all"
select top 15 * from
(
select * from t1
union all
select * from t2
union all
select * from t3
....
union all
select * from tn
) a where 标题=10

select top 15 * from
(
select * from t1
union all
select * from t2
union all
select * from t3
....
union all
select * from tn
) a where 内容 like '%aaa%'

34,623

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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