how many type of subquery?
Answers were Sorted based on User's Feedback
Answer / rajkumar
As database developer, you must have ever written
subqueries in either SQL Server or any other database
platform. This article will describe shortly about types of
subquery.
A subquery is inner query that will be used by outer query.
A subquery could return scalar value or a series of value.
Based on query dependency, a subquery could be self-
contained or correlated one. A self-contained subquery is a
subquery independent from outer query, and correlated
subquery is a subquery that is referencing to a row in
outer query.
Self-contained subquery is easier to debug than correlated
subquery. And it is executed only once whereas correlated
subquery is executed once for each row of outer query.
Sample of self-contained subquery that returns scalar value
is shown below :
Select customerid
From dbo.orders
Where employeeid = (select employeeid from dbo.employees
where lastname = ‘RAJ’);
This query returns customers list whose employee is RAJ.
Is This Answer Correct ? | 9 Yes | 1 No |
How to convert a numeric expression from one data type to another?
What is store procedure?
whats new about truncate in sql server 2008?
0 Answers MedSave Healthcare, Serco,
how to get the automatic backup of the database in the sql server
What is the maximum size of column in sql server?
How to find the last update record in SQL Server?
What value could be assigned to Varchar Type?
What is query optimizer in sql server?
Hi, I Created 3 Tables Person(PersID[prkey],Name,Email,Password), Project(ProjName,ProjID[prkey],ProjLeader,ProjManager) & ProjectInvolvement(EntryDate,ProjID[frkey],PersID[frkey],ProjDuration). For this how can i INSERT,UPDATE & DELETE Through PROCEDURE? Please Post the Answer for me. Desai.
Can the “if update (colname)” statement be used in a delete trigger?
Show Practically Sql Server Views are updatable?
Suppose i have a table that contains 5 columns like col1,col2...colm5.I want to import only two column through BCP utility.How to do same through BCP in sybase.