You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Yuri Au Yong (JIRA)" <ji...@apache.org> on 2015/04/07 09:10:12 UTC

[jira] [Commented] (CALCITE-259) Using sub-queries in CASE statement against JDBC tables generates invalid Oracle SQL

    [ https://issues.apache.org/jira/browse/CALCITE-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14482721#comment-14482721 ] 

Yuri Au Yong commented on CALCITE-259:
--------------------------------------

I having the same issue when executing query on hsqldb (e.g.: “select RNUM, C1, C2 from TJOIN2 where C1 = ( select C1 from TJOIN1 WHERE RNUM=0)”). Any pointers on where this SINGLE_VALUE is being resolved?

> Using sub-queries in CASE statement against JDBC tables generates invalid Oracle SQL
> ------------------------------------------------------------------------------------
>
>                 Key: CALCITE-259
>                 URL: https://issues.apache.org/jira/browse/CALCITE-259
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: GitHub Import
>              Labels: github-import
>
> 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|https://github.com/kunal-mahale]
> Labels: duplicate, 
> Created at: Fri Apr 25 06:41:04 CEST 2014
> State: open



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)