Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Question on PL/SQL statement.
feilip_at_gmail.com wrote:
> I inherit the following PL/SQL statement:
This is SQL, not PL/SQL. Never mind.
> EXEC SQL SELECT COUNT(*)
> INTO :rowcount
> FROM MY_LIST L1,
> MY_LIST L2
> WHERE L1.key_no = L2.key_no
> AND L1.supply_code = L2.supply_code
> AND L1.batch_id = '1'
> AND L1.send_delete_ind = 'Y'
> AND L2.batch_id = '1'
> AND L2.send_delete_ind = 'N';
>
> I don't understand why it needs L1 and L2. Is the above code the same
> as the following:
>
> EXEC SQL SELECT COUNT(*)
> INTO :rowcount
> FROM MY_LIST L1
> WHERE L1.send_delete_ind = 'Y'
> OR L1.send_delete_ind = 'N';
The two statements are quite different; try on the following table:
key_no | support_code | batch_id | send_delete_ind
-------+--------------+----------+---------------- 1 | 1 | 1 | Y 1 | 2 | 2 | N
Yours,
Laurenz Albe
Received on Wed Jun 14 2006 - 02:44:57 CDT
![]() |
![]() |