表中有A,B,C三個型別,要求取出僅在早上出現的型別和數量,也就是要得出A 2這樣的結果,這種需求有什么好的辦法嗎
uj5u.com熱心網友回復:
什么意思,select * from tab_name where 級別='早上';
這樣么?
不重復是指什么資料不重復?
uj5u.com熱心網友回復:
select a.*
from tab_name a
where a.級別='早上'
and a.型別 not in (select 型別 from tab_name where 級別<>'早上')
uj5u.com熱心網友回復:
select * from (
select t1.*, count(decode(t1.型別, 'zaoshang', null, 1)) over(partition by t1.b) cn from tab1 t1
) t1 where t1.cn = 0
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/21215.html
標籤:基礎和管理
上一篇:update中if判斷復核用
