Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-259

Using sub-queries in CASE statement against JDBC tables generates invalid Oracle SQL

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0-incubating
    • None

    Description

      1.
      select e.NAME,
      (CASE e.dept_ID WHEN (Select d.id from PV_ADMIN.dept d where d.id = e.dept_id)
      THEN (Select d.name from PV_ADMIN.dept d where d.id = e.dept_id)
      ELSE 'DepartmentNotFound' END ) AS DEPTNAME
      from PV_ADMIN.EMP e;

      2.
      select e.NAME,
      CASE WHEN e.dept_ID = (select d.ID from PV_ADMIN.dept d where d.NAME = 'SALES') then 'SALES'
      ELSE 'Not Matched.'
      END as department
      from PV_ADMIN.EMP e ;

      ---------------- Imported from GitHub ----------------
      Url: https://github.com/julianhyde/optiq/issues/259
      Created by: kunal-mahale
      Labels: duplicate,
      Created at: Fri Apr 25 06:41:04 CEST 2014
      State: open

      Attachments

        1. CALCITE-259-MYSQL-SINGLE_VALUE-0.1.patch
          7 kB
          YeongWei
        2. [CALCITE-259]-Description.patch
          7 kB
          Yuri Au Yong
        3. [CALCITE-259]-Description.patch
          3 kB
          Yuri Au Yong

        Activity

          People

            julianhyde Julian Hyde
            github-import GitHub Import
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: