Subject | Re: Why this sql not work ? |
---|---|
Author | nathanelrick |
Post date | 2012-03-20T09:51:48Z |
ooops sorry my fault i made a mistake
yes, i want to say
Select
(select ...) AS MyFIELD2
IIF(MyField2 is null, select ...., Null) As MYField3
From
yes, i want to say
Select
(select ...) AS MyFIELD2
IIF(MyField2 is null, select ...., Null) As MYField3
From
--- In firebird-support@yahoogroups.com, Mark Rotteveel <mark@...> wrote:
>
> On Tue, 20 Mar 2012 06:46:53 -0000, "nathanelrick" <nathanelrick@...>
> wrote:
> > hello,
> >
> > Select
> > Field1,
> > (select ...) AS MyFIELD2
> > IIF(MyField is null, select ...., Null) As MYField3
> > From
> > ....
> >
> > it's not work, it's say unknow "MyField"
> > but if i replace MyFIELD2 by Field1 it's work ...
> >
> > is their any workaround to make this SQL work ?
>
> I don't see a MyField in that query. Also: you can't reference fields by
> an alias that is defined in the same (sub)query. If you want to do that you
> will need to wrap the first query in another query. In that query you will
> be able the reference the field by alias.
>
> Mark
>