Home » SQL & PL/SQL » SQL & PL/SQL » Select only values that appear more than x times
Select only values that appear more than x times [message #19351] Tue, 12 March 2002 22:15 Go to next message
Nagy Arpad
Messages: 1
Registered: March 2002
Junior Member
Hy.
I would like to try to select from a table only those rows where the value of a key column appears more than x times in the table (x=1, 2, 3 etc)
(More than once to be more specific)
Can someone help ???

Thanx!!!
Re: Select only values that appear more than x times [message #19352 is a reply to message #19351] Tue, 12 March 2002 22:43 Go to previous messageGo to next message
Karri
Messages: 33
Registered: May 2001
Member
I think that this will hepl U!

SELECT PART_NO, COUNT(PART_NO) FROM INVENTORY_PART
GROUP BY PART_NO
HAVING COUNT(PART_NO)>'&HOW_MANY'
Re: Select only values that appear more than x times [message #19407 is a reply to message #19351] Thu, 14 March 2002 18:44 Go to previous message
jeya
Messages: 18
Registered: January 2001
Junior Member
select keyfield from emp where &n<(select count(*) from emp order by keyfield)
Previous Topic: urgent
Next Topic: how to know the recent queries fired in oracle from the front end
Goto Forum:
  


Current Time: Fri Apr 19 00:56:47 CDT 2024