We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
SET SERVEROUTPUT ON
DECLARE
CURSOR ISHI IS SELECT * FROM CITY WHERE POPULATION>=100000 AND COUNTRYCODE='USA';
DIS CITY%ROWTYPE;
BEGIN
OPEN ISHI;
LOOP
FETCH ISHI INTO DIS;
EXIT WHEN ISHI%NOTFOUND;
DBMS_OUTPUT.PUT_LINE(DIS.ID||' '||DIS.NAME||' ' ||DIS.COUNTRYCODE||' '||DIS.DISTRICT||' '||DIS.POPULATION);
END LOOP;
CLOSE ISHI;
END;
/
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Revising the Select Query I
You are viewing a single comment's thread. Return to all comments →
SET SERVEROUTPUT ON DECLARE CURSOR ISHI IS SELECT * FROM CITY WHERE POPULATION>=100000 AND COUNTRYCODE='USA'; DIS CITY%ROWTYPE; BEGIN OPEN ISHI; LOOP FETCH ISHI INTO DIS; EXIT WHEN ISHI%NOTFOUND; DBMS_OUTPUT.PUT_LINE(DIS.ID||' '||DIS.NAME||' ' ||DIS.COUNTRYCODE||' '||DIS.DISTRICT||' '||DIS.POPULATION); END LOOP; CLOSE ISHI; END; /