Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How can I cut off a query after 3 lines?
SELECT machine_name, login, Count(login) AS CountOfLogin
FROM login_history
WHERE ROWNUM < 4
group by machine_name, login
order by count(login) desc;
>>> mkirk_at_hot.ee 05/04/01 01:25PM >>>
Q: how can you specify with a select statement how many rows are given as a
result? I would only like to get the first three lines.....
here is what I have....
1 SELECT machine_name, login, Count(login) AS CountOfLogin FROM
login_history
2 group by machine_name, login
3* order by count(login) desc
4 ;
MACHINE_NAME LOGIN COUNTOFLOGIN
---------------- ---------- ------------ mocha Jeff 3 reeses Paul 3 spice Tamara 3 mocha Rudy 2 reeses Jeff 1 reeses Ravie 1 reeses Tonya 1 spice Rudy 1
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: MKirk INET: mkirk_at_hot.ee Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: William Beilstein INET: BeilstWH_at_obg.com Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Fri May 04 2001 - 13:15:28 CDT
![]() |
![]() |