SubQuery

SELECT * FROM (SELECT ROWNUM AS NUM, MEMBER.* FROM MEMBER) WHERE NUM BETWEEN 5 AND 10; SELECT * FROM (SELECT * FROM MEMBER ORDER BY NAME DESC) WHERE ROWNUM BETWEEN 1 AND 10; SELECT * FROM MEMBER WHERE AGE > (SELECT AVG(AGE) FROM MEMBER); SELECT * FROM MEMBER WHERE AGE > ALL(SELECT AVG(AGE) FROM MEMBER GROUP BY ADDRESS); SELECT * FROM MEMBER M WHERE EXISTS (SELECT NULL FROM MEMBER GROUP BY MAJOR HAVING M.AGE = AVG(AGE));

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.