大牛们,请教一个数据库查询问题 数据库 mysql表 art 字段 id cate addtime已知id 求排序后这条记录所在cate下'前面'有多么条记录数和这条记录的cate,按addtime降序一句SQLmysqlsql排序查询 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 试一下这个sql:select count(id) as '记录数',(select cate from art where id='已知id') as '这条记录的cate' from art where id>='这条记录的cate'; 后面的按addtime降序,不知何意 修改了一下:select count(id) as '记录数',(select cate from art where id='已知id') as '这条记录的cate' from art where id>='已知id'; select count(*),x.catefrom art x,(select * from art order by addtime DESC) tempwhere x.id=the_known_idand temp.addtime<x.addtime;试下 lz 的问题是不是 查询已知id前面有多少条记录 及 已知id这条记录的所有信息是吧 asp->php spl_autoload_register(array('Think', 'autoload')) 正则表达式,求帮忙!!! 什么叫静态网站,一般都怎么做。 怎么动态获取html文件里的一段指定内容? 时间函数问题 php与数据库连接的简单问题,mysql_num_rows和mysql_fetch_array这两个函数用不好,在线等 有人可帮我这个初学者的忙吗?谢放谢! 1○○分 求:计算在线用户 的程序! php 合成图片出错 急,如何用php对url的参数进行加密解密 pear类调用问题
select count(id) as '记录数',(select cate from art where id='已知id') as '这条记录的cate' from art where id>='这条记录的cate';
from art x,(select * from art order by addtime DESC) temp
where x.id=the_known_id
and temp.addtime<x.addtime;试下