Professional Documents
Culture Documents
Sub-Query in SELECT clause is nothing but providing SELECT statement in the place of column name. Sub query in SELECT should always return one value. It can be Independent query or it can be dependent by joining with one of table/view in from clause.
Chapter 1: Introduction
What is a Database? What is DBMS? What is RDBMS? What is SQL? RDBMS Products In The Market
Example1:SLSLC epo Q>EET mn, eae nm, sl a, (EETMX(a)FO ep SLC A sl RM m) mxa FO ep asl RM m;
Chapter 3: DDL
C reate Table SQL Alter Table Truncate Table Drop Table Rename Table
Chapter 4: DML
Insert C ommand Update C ommand Delete C ommand Merge C ommand
In the above example we have provided SELECT STATEMENT in the place of column name which will return only single value. If we try to return multiple values, system will raise an error which is shown below.
Chapter 5: Constraints
What are C onstraints? Not Null C onstraint C heck C onstraint Unique C onstraint Primary Key C onstraint Foreign Key C onstraint ON Delete C ascade C omposite Keys
SLSLC epo Q>EET mn, eae nm, sl a, (EETMX(a)FO ep GOPB dpn) SLC A sl RM m RU Y eto mxa FO ep asl RM m;
Output:ORA-01427: single-row sub query returns more than one row. In the above SELECT STATEMENT use of GROUP BY returns multiple values.
Chapter 6: TCL
Oracle SQL C ommit Rollback Savepoint
Example2:In this example we are trying to fetch highest and lowest salary for each department.
Chapter 7: DCL
Grant Revoke
SLSLC epo Q>EET mn, eae nm, sl a, dpn, eto (EETmn(a)FO epWEEdpn=.etolsl SLC i sl RM m HR etoedpn)oa, (EETmx(a)FO epWEEdpn=.eto hsl SLC a sl RM m HR etoedpn) ia FO EPeODRB dpn; RM M RE Y eto
Chapter 9: Operators
SQL Operators SQL Types of Operators IN & NOT IN
newtonapples.com/or16-51-sub-query-in-select-clause/
1/4
2/11/13
BETWEEN, NOT BETWEEN LIKE, NOT LIKE IS NULL, IS NOT NULL C oncatenation ( || ) Operator
newtonapples.com/or16-51-sub-query-in-select-clause/
2/4
2/11/13
UNION UNION ALL INTERSEC T MINUS
Video Tutorials Expert Atricles Tips and Code Assignments & Quizzes Corner Interview Questions
.. See other relevant topics Oracle PL/SQL Oracle Financials Oracle DBA Oracle Forms and Reports Oracle Apps
Comments Closed
Testimonials
I've been a member since they started and I'm proud to tell you all that I have grow to the level of being a faculty at Newton Apples - Anusha
Tag Cloud
basics bill inmon bottom up c
Most Viewed
Notable new Features in DataStage 8.5 DS|02|-06. Stages in DataStage Unix Scripts to run DataStage jobs
newtonapples.com/or16-51-sub-query-in-select-clause/
3/4
2/11/13
oaf operator
DS|01|-02. DataStage Architecture & Client Components DS|01|-04. Parallel Processing & Partition Techniques DataStage Job Status Automation DS|00|-01. IBM InfoSphere DataStage
operators
Oracle
oracleapps oracleplsql
Oracle SQL package PLSQL
sequence
snowflake
Sql
xmlpublisher
Newton Apples Copying, replication, and distribution of content available on NewtonApples.com is prohibited
newtonapples.com/or16-51-sub-query-in-select-clause/
4/4