﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Teradata Forums / Analytical Applications / Teradata   / Why subqueries in case are not working in teradata? / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Teradata Forums</description><link>http://www.teradata.com/teradataforum/</link><webMaster>info@teradata.com</webMaster><lastBuildDate>Tue, 14 Oct 2008 09:42:40 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Why subqueries in case are not working in teradata?</title><link>http://www.teradata.com/teradataforum/Topic11386-5-1.aspx</link><description>Hi Jack,Teradata supports Scalar Subqueries only in some special cases within WHERE/HAVING.You'll have to rewrite it to (Outer) Joins.Dieter</description><pubDate>Thu, 08 May 2008 10:53:17 GMT</pubDate><dc:creator>dnoeth</dc:creator></item><item><title>RE: Why subqueries in case are not working in teradata?</title><link>http://www.teradata.com/teradataforum/Topic11386-5-1.aspx</link><description>hi,WHEN search conditions cannot contain SELECT statements.try using a derived table instead.thx</description><pubDate>Thu, 08 May 2008 09:47:52 GMT</pubDate><dc:creator>SN</dc:creator></item><item><title>Why subqueries in case are not working in teradata?</title><link>http://www.teradata.com/teradataforum/Topic11386-5-1.aspx</link><description>Please look at the query belowselect         ename from         emp e where         not exists(select                               'x'                         from                                dept d                         where                                d.deptno=case                                              when d.deptname in (select                                                                                  deptname                                                                            from xdepartments                                                                           )                                               then                                                       20                                                 else                                                        50                                                  end                               );In the place of subquery     "select  deptname from xdepartments" , if I use hardcoded values like 100,200,3000 then it is working fine but I don't know why It is not working if I use subquery like above It's giving an error message..Please Help me out...I am using teradata SQL Assistant 7.1and getting Error message as : Illegal expression in when clause of case expression.Please help me outThanx Regards,jack</description><pubDate>Thu, 08 May 2008 09:18:40 GMT</pubDate><dc:creator>JACKSON</dc:creator></item></channel></rss>