Try this query also
Code:
select c_id,cnt from
(SELECT c_id, count(c_id) cnt FROM customer
group by c_id
having c_id = min(c_id))
where rownum<=1

Originally Posted by
mandy4ever
Hi,
I'm trying to execute a simple query that returns the minimum value from a column and the count of it:
SELECT c_id, count(c_id) FROM customer
having c_id = min(c_id)
group by c_id
But instead of returning a single row (the minimum value) this returns ALL the c_id's in this table along with their count. can someone please tell me where I'm going wrong.
Thanks in advance.