英语翻译select top 4 * from shop_books where anclassid = (select
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/10 04:02:30
英语翻译
select top 4 * from shop_books where anclassid = (select anclassid from shop_books where bookid = "&request("id")&") order by liulancount ,chengjiaocount,adddate desc
这段代码大概的意思就是显示,查询字段的前4个数据,而我现在想让他显示,这个数据和这个数据紧挨的三个数据.就像
1
2
3
4
5
如果request("id")=2
我想让这段代码显示 2 3 4 5 我该如何写呢,
select top 4 * from shop_books where anclassid = (select anclassid from shop_books where bookid = "&request("id")&") order by liulancount ,chengjiaocount,adddate desc
这段代码大概的意思就是显示,查询字段的前4个数据,而我现在想让他显示,这个数据和这个数据紧挨的三个数据.就像
1
2
3
4
5
如果request("id")=2
我想让这段代码显示 2 3 4 5 我该如何写呢,
这个不是ASP代码,是SQL语句
从shop_books数据库中查询bookid = "&request("id")&"的anclassid
然后从shop_books数据库中查询top 4(最上面的记录)
anclassid = 刚才查询的anclassid
然后按照 liulancount ,chengjiaocount,adddate desc 排序
楼上的是"select * from shop_books where anclassid = 31"
补充
select * from shop_books where anclassid = (select anclassid from shop_books where bookid = "&request("id")&") and anclassid = (select anclassid from shop_books where bookid = "&request("id+1")&") order by liulancount ,chengjiaocount,adddate desc
用AND连接
从shop_books数据库中查询bookid = "&request("id")&"的anclassid
然后从shop_books数据库中查询top 4(最上面的记录)
anclassid = 刚才查询的anclassid
然后按照 liulancount ,chengjiaocount,adddate desc 排序
楼上的是"select * from shop_books where anclassid = 31"
补充
select * from shop_books where anclassid = (select anclassid from shop_books where bookid = "&request("id")&") and anclassid = (select anclassid from shop_books where bookid = "&request("id+1")&") order by liulancount ,chengjiaocount,adddate desc
用AND连接
英语翻译select top 4 * from shop_books where anclassid = (select
英语翻译strQuery = "select * from suppliers where CompanyName='"
select * from book where 1=1
select max(account_id ) from(select top 5 account_id from ac
sql语句中参数乘法select top 4 *from UserInfowhere ID not in(select
select * from teacher where s_id in(select s_id from student
select * from order where clientNo in (select distinct(clien
SELECT student_id FROM tuition where student_id in ( SELECT
oracle 子查询:select *,(select account from t_ps_member m where
select * from user_info where user_name in (select user_name
ms sql :select * from (select *from b) as xxx where 和 select
$query = "SELECT * FROM student_info WHERE name = '".$login_