Re: Syntax problem with select from (if (exists (select....
From: Kalen Delaney (replies_at_public_newsgroups.com)
Date: 07/13/04
- Next message: Aaron [SQL Server MVP]: "Re: Execute the results of a query"
- Previous message: Kalen Delaney: "Re: finding # days in date range"
- In reply to: Panks: "Re: Syntax problem with select from (if (exists (select...."
- Next in thread: Joe Celko: "Re: Syntax problem with select from (if (exists (select...."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 05:01:58 -0700
SQL Server's TSQL language does not support IIF.
-- HTH ---------------- Kalen Delaney SQL Server MVP www.SolidQualityLearning.com "Panks" <agarwalp@eeism.com> wrote in message news:uGVlFmMaEHA.3112@TK2MSFTNGP09.phx.gbl... > try using 'iif' instead of if. iif can be used in SQL statements. I have > used it in MS Access but not in SQL. > > Syntax: iif(Logical expression, true,false) > > > "Jochen Daum" <jochen.daum@cabletalk.co.nz> wrote in message > news:jb26f01pq4jns227k8igbo2gspeprhnqdq@4ax.com... > > Hi, > > > > I want to integrate a subquery returning a boolean value into a query, > > but I seem to have a synatx problem: > > > > Simplified it is > > > > select x from (if (exists (select 1)) 1 as x) as y (x) > > > > I am always confused by the lack of a 'then' so I think thats probably > > where my mistake lies, but I can't seem to figgure it out. What ever I > > do wity the if, there is always a syntax error near '(if' . I have put > > the query in a range of lines in the QA to narrow down the error, but > > it doesn't seem to be moving and I can't grasp, whats wrong with '(if' > > > > Any help? > > > > Jochen > > > > > > -- > > Jochen Daum - Cabletalk Group Ltd. > > PHP DB Edit Toolkit -- PHP scripts for building > > database editing interfaces. > > http://sourceforge.net/projects/phpdbedittk/ > >
- Next message: Aaron [SQL Server MVP]: "Re: Execute the results of a query"
- Previous message: Kalen Delaney: "Re: finding # days in date range"
- In reply to: Panks: "Re: Syntax problem with select from (if (exists (select...."
- Next in thread: Joe Celko: "Re: Syntax problem with select from (if (exists (select...."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|