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.
Revising the Select Query II
Revising the Select Query II
Sort by
recency
|
687 Discussions
|
Please Login in order to post a comment
ORACLE PL/SQL:
SET SERVEROUTPUT ON; BEGIN FOR r in (SELECT name FROM CITY WHERE POPULATION>120000 AND COUNTRYCODE ='USA') LOOP DBMS_OUTPUT.PUT_LINE(r.name); END LOOP; END; /
SELECT NAME FROM CITY WHERE CountryCode = 'USA' AND Population > 120000;
It works!
MYSQL
SELECT NAME FROM CITY Where COUNTRYCODE = 'USA' AND POPULATION > 120000;
SELECT NAME FROM CITY WHERE COUNTRYCODE = 'USA' AND POPULATION > 120000 ORDER BY NAME;
The query is simple but here are the problems I faced the resolutions. 1. switch to MySQL 2. do not leave any blank lines, just 1 line of query 3. 12 is follwed by four zeros :) and i kept writing 12000 4. keep the where clause within parenthesis select NAME from CITY where (COUNTRYCODE = 'USA' and POPULATION > 120000);