sql产品查询问题?

php_wsd 2010-07-15 01:13:15
像taobao这样网站的产品查询,如果我搜索一个产品,在搜索结果页面上,同一个页面上不会出现一个商家的两个产品,这种产品查询是如何实现的?
我建了一个表
Product表,字段如下
productid(产品ID) productname(产品名) userid(数字型字段,对应用户ID)updatetime(更新时间)

大家是如何解决的?
...全文
95 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
gingerkang 2010-07-16
  • 打赏
  • 举报
回复
select * from product a where productid=(select top 1 productid from product where userid=a.userid order by updatetime desc)
php_wsd 2010-07-16
  • 打赏
  • 举报
回复
再顶一次
ChinaXtHuLang 2010-07-16
  • 打赏
  • 举报
回复
我也来玩:
select * from product a where productid=(select top 1 productid from product where userid=a.userid order by updatetime desc)
wqjywyg2009 2010-07-16
  • 打赏
  • 举报
回复
select * from product a where productid=(select top 1 productid from product where userid=a.userid order by updatetime desc)
php_wsd 2010-07-15
  • 打赏
  • 举报
回复

回复内容太短了!

28,391

社区成员

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

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