Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print first value of output?

Status
Not open for further replies.

vb89

MIS
Aug 21, 2008
47
US
I have the following query
Code:
 SELECT count(*), COUNTRY_DESC 
FROM customer_data.cd_soccer_field_season 
WHERE SEASON_ID = 200849 
group by country_desc
order by count(*)desc

how do i go about printing out only the first row of the output?
 
Try this
Code:
SELECT * 
  FROM
(
 SELECT count(*), COUNTRY_DESC 
   FROM customer_data.cd_soccer_field_season 
  WHERE SEASON_ID = 200849 
  GROUP BY country_desc
  ORDER BY count(*)desc
)
 WHERE ROWNUM < 2;

Regards

T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top