select ...
from
(select Product.*, row_number() over(partition by cust_id order by PRODUCT_ID) rk from Product)
where rk = 1
from
(select Product.*, row_number() over(partition by cust_id order by PRODUCT_ID) rk from Product)
where rk = 1
解决方案 »
- 如何删除相同表头的表中的数据,求SQL
- oracle中的system账户问题
- 求助:ORA-01033: ORACLE initialization or shutdown in progress
- 关于Oracle备份
- (求助)Oracle 9i ---->SQL server
- ORACLE分组查询的问题~
- 如何把70万的数据倒出来!生成TXT文件
- 得到相同NO對應Q的最後一次變更的DATE ,謝謝 剛才給分太急,請見諒
- sql plus连接不上数据库,帮忙看看?
- 内储的问题:update...where (select count(*)...
- 急!请教一个定时update数据库的问题
- 高手来回答,如何按每人每天来group by
select ...
from Customer cust,
(select cust_id, min(product_id) from Product group by cust_id) prod
where cust.cust_id = prod.cust_id
就很好阿
from Customer cust,product prod
where cust.cust_id=prod.cust_id
and prod.product_id=(select min(product_id) from product where cust_id=prod.cust_id)
其实一样,性能可能还差一点