On Jun 18, 10:06 am, Mouhammed Iyad <iya...@gmail.com> wrote:
> Dears,
>
> I have the following table
>
> act_Month   Beginning_of_period     end_of_period
> ------------------------------------------------------------------
> 2009-01       300                            350
> 2009-02       350                            310
> 2009-03       310                            301
> 2009-04       301                            340
> 2009-05       340                            330
>
> what i need is
> select left(act_month,4) ,
> Beginning_of_period value for the minimum month,
> end_of_period value for the maximum month
> from my_table
>
> in our example will give me
> 2009      , 300           , 330
>
> Many thanks for your assistant,
> Best Regards,
> Iyad

You do not provide enough information to answer the question.  How is
act_month defined, as a varchar2 or as a date?  From your example it
appears to be a varchar2, and for that you'd use substr():

select substr(act_month, 1, 4), beginning_of_period, end_of_period
from my_table;


All of this information is available in the online documentation found
here:

http://tahiti.oracle.com


David Fitzjarrell
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Oracle PL/SQL" group.
To post to this group, send email to Oracle-PLSQL@googlegroups.com
To unsubscribe from this group, send email to
oracle-plsql-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to