Subject | Re: [ib-support] Is these SQL statement result equal ? |
---|---|
Author | Andrew Guts |
Post date | 2002-09-20T13:39:41Z |
Roland Turcan wrote:
from both. (2) may cause column name conflict.
Both statements are targeted to return the same rows, but first may fail
if subselect returns huge recordset. Join (in 2) is more effective.
>Hello ib-support@yahoogroups.com!(1) selects all columns from first table, but (2) selects all columns
>
>1.
>
>SELECT * FROM POKLADNA
>WHERE JEDIN IN (SELECT RECORD_ID FROM SYS$REP
> WHERE TABULKA='POKLADNA' AND
> ZMENA<>'D' AND
> JEDIN>40000
>);
>
>
>2.
>
>select *
>from pokladna a
>join sys$rep b on b.record_id=a.jedin
>and b.tabulka='POKLADNA' and b.ZMENA<>'D'
>and b.JEDIN>40000;
>
>So ?
>
>
from both. (2) may cause column name conflict.
Both statements are targeted to return the same rows, but first may fail
if subselect returns huge recordset. Join (in 2) is more effective.