A few db2 things from Scott Forstie's presentation

Discussion in 'DB2' started by Andy Warren, Oct 7, 2017.

  1. Andy Warren

    Andy Warren New Member

    Here are a few things that I picked up from Scott Forstie's db2 presentation:
    truncate - acts like delete from, - essentially clrpfm on a table
    listagg
    I think of LISTAGG as transposing a column to a row. An example is that LISTAGG can turn a column
    Fred
    Mary
    John
    Eliot

    into a single row result of
    Fred, John, Mary, Eliot
    Check out the IBM Developerworks article on it for examples.

    varchar_format
    Like EDTWRD or printf - applies a format to a variable

    limit
    Acts like fetch first. Came from mySQL
    For example,
    select * from bigtable limit 50
    will select the first 50 rows

    Michael Santoserra wrote a good article explaining this for ITJungle

    lateral
    This is similar in concept to using a CTE (Common Table Expression.)
    Michael Santoserra wrote another ITJungle article clearly explaining Lateral
     

Share This Page