Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Help with removing dupes from a string with perl (last)

by tye (Sage)
on Jul 09, 2009 at 18:48 UTC ( [id://778659]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    create function first_nonnull( one anyelement, two anyelement )
        returns anyelement
    ...
      , sfunc = last
      , finalfunc = first
    );
    
  2. or download this
    select first(v), first_nonnull(v), last(v), last_nonnull(v)
    from ( select NULL::text as v union all
    ...
    select first(v), first_nonnull(v), last(v), last_nonnull(v)
    from ( select 'one'::text as v union all
        select 'two' as v union all select NULL as v ) as q;
    
  3. or download this
     first | first_nonnull | last | last_nonnull
    -------+---------------+------+--------------
           | one           | two  | two
     one   | one           |      | two
    (2 rows)
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://778659]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2024-03-28 08:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found