Re: corelated query

From: Hari (hari_prasad_k_at_hotmail.com)
Date: 05/25/04


Date: Tue, 25 May 2004 12:15:25 +0530

Hi,

 Subquery

A SELECT statement nested inside another SELECT, INSERT, UPDATE, or DELETE
statement, or inside another subquery.

select * from emp where emp_no in(select * from emp_details)

Correlated subquery

A subquery that references a column in the outer statement. The inner query
is executed for each candidate row in the outer statement.

select * from emp where emp_id in(select emp_id from emp_details a
where a.emp_id=emp.emp_id )

Thanks
Hari
MCDBA

"Ramesh" <ramesh@mail.punecity.com> wrote in message
news:up4jW$hQEHA.3452@TK2MSFTNGP10.phx.gbl...
> Dear All
> Please Explain me diff between corelated query and subquery with a example
> Ramesh:)
>
>
>
>



Relevant Pages

  • Correllated Subquery, unresolving outer references
    ... I'm trying to form a correlated subquery (right now, ... same query against the MS SQL tables directly). ... or a link explaining exactly how to write outer references with MS ...
    (comp.databases.ms-access)
  • ADO Shape and Subqueries
    ... existing column (that is currently returned in a child recordset) with a ... subquery that references two tables that are currently referenced by the ... However, when I try the subquery, I get an 'unexpected error' ... Query Analyzer), it works just fine. ...
    (microsoft.public.data.ado)
  • too few parameters - Sub Query
    ... I am running a query which references a subquery. ... the criteria in the ... I am receiving the error: ...
    (microsoft.public.access.queries)