On Mar 22, 12:58 pm, Martin Fischer <[email protected]>
wrote:
> Hi Scott,
>
> i´m a GoogleGropus-beginner but i hope you´ll find that useful.
>
> For a gapless cycle of numbers i would use the pseudocolumn "rownum".
>
> example : select rownum, * from dummytable
>
> convert it to char and fill the missing leading "0" with lpad like
> this:
>
> select lpad(to_char(rownum),3,'0'), * from dummytable
>
> concat the cycle using the pipe like that:
>
> select to_char(sysdate,'dd\mm\yyyy') || lpad(to_char(rownum),3,'0')
> from dummytable
>
> hope that helps
>
> Martin
>
> On 20 Mrz., 18:48, Scott <[email protected]> wrote:
>
>
>
> > I need a way to add a column to a query that will display output based
> > on another date field and append a row counter.
> > Format looks like this:
> > 12/01/2008001
> > 12/01/2008002
> > 12/01/2008003
> > 12/01/2008004
> > 12/01/2008005
> > 12/01/2008006
> > 12/01/2008007
> > 12/01/2008008
> > 12/01/2008009
> > 12/01/2008010
>
> > etc
>
> > Would I use sequence?
> > Any help is appreciated, thanks.- Hide quoted text -
>
> - Show quoted text -
That might work, however we don't know if the counter is to be reset
with each new date value, and if that is the case using ROWNUM "won't
fill the bill" as it's not reset until a new result set is generated.
We really need more information before any suggestions can be made.
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Oracle-PLSQL?hl=en
-~----------~----~----~----~------~----~------~--~---