Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Simple question ...
On Fri, 6 Aug 2004 15:13:24 +0200, "Ernest Morariu"
<ernest_at_gesora.com> wrote:
...
>
>SELECT myField INTO myVariable FROM myTable WHERE myCondition;
>
...
You could alter this slightly:
SELECT MAX(myField) INTO myVariable FROM myTable WHERE myCondition;
In case of no records this will yield NULL In case of one record this will yield myField
But note: the case of more than one record will now not error.
Jaap. Received on Fri Aug 06 2004 - 16:25:15 CDT
![]() |
![]() |