由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - 问个SQL query
相关主题
请教SQL问题请推荐SQL书
Q:实现上一个, 下一个, 产品功能SQL query 求解!
这题怎么做请教SQL Query 面试题
初级SQL问题考大家一道SQL面试题
error of executing SQL query of string concatenation (转载公司招聘BI reporting developer
脸家,选product还是infrastructure请帮忙回答一个SQL问题
问个sql题有什么比较好的学习sql的书或视频吗?
Job opening in CT: Software Quality Engineer求助啊,Amazon的software quality engineer的phone interview
相关话题的讨论汇总
话题: time话题: product话题: seller话题: purchase话题: prod
进入JobHunting版参与讨论
1 (共1页)
o******y
发帖数: 13
1
我们有 two tables purchase(pur_id, cust_id, prod_id, p_price, p_time) and
product(prod_id, seller_id, s_time, s_price), where the primary key of
purchase is pur_id, and the primary key of product is prod_id, seller_id,
time.
To find all sellers who sell the product in purchase 001, list the seller id
, his most recent selling time for the product, and the price at this time.
Assume that there is only one product in each purchase.
SELECT seller_id, MAX(s_time) as recent_time, s_price
FROM product pd
t**d
发帖数: 352
2
select seller_id, s_price from product p1 ,
( select seller_id, max(s_time) recent_time from
product pd, purchase pc
WHERE pd.prod_id = pc.prod_id
AND pc.pur_id = '001'
GROUP BY seller_id) t where p1.seller_id = t.seller_id and
p1.s_time = t.recent_time;
1 (共1页)
进入JobHunting版参与讨论
相关主题
求助啊,Amazon的software quality engineer的phone interviewerror of executing SQL query of string concatenation (转载
【招聘】统计师-上海-全职-互联网广告脸家,选product还是infrastructure
面试面数据结构、算法、玩C++,现在每天工作我……问个sql题
没有技术背景的Analyst在湾区真的能做得长久么?Job opening in CT: Software Quality Engineer
请教SQL问题请推荐SQL书
Q:实现上一个, 下一个, 产品功能SQL query 求解!
这题怎么做请教SQL Query 面试题
初级SQL问题考大家一道SQL面试题
相关话题的讨论汇总
话题: time话题: product话题: seller话题: purchase话题: prod