Uploaded image for project: 'Teiid'
  1. Teiid
  2. TEIID-2497

Add support for DECODE(column, column_value, column_to_replace_with)

XMLWordPrintable

    • Icon: Feature Request Feature Request
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • 7.7.6
    • Query Engine
    • None

      Looking at pivot and trying to use it like:

      Select salesperson, SUM(DECODE(product, 'CarA', amount)) as ProductCarA,
      SUM(DECODE(product, 'CarB', amount)) as ProductCarB,
      SUM(DECODE(product, 'CarC', amount)) as ProductCarC
      From SALES
      Group By salesperson

      Teiid's Decode requires you to know the value to substitute, with this option, it can be dynamically substituted at run time.

      See: http://www.clearpeaks.com/blog/data-warehousing/pivot-data-in-sql

            rhn-engineering-shawkins Steven Hawkins
            van.halbert Van Halbert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: