Subject | Re: [Firebird-Java] Re: Query returning row when it shouldn't... |
---|---|
Author | Helen Borrie |
Post date | 2004-05-31T08:26:22Z |
At 07:54 AM 31/05/2004 +0000, you wrote:
rsname.
This guy is really hard to convince that, if you ask a question in SQL that
returns a result, you'll get a result. Here and in support, he insists that
there should be NO result if the answer is null.
He ought to use whatever it takes to get
select (what you want) from atable
where exists (select 1 from atable)
That does both tasks in a single query, in the proper manner for SQL,
without wasting a second hit on the database.
H.
>two things/thinks about it;Yes it does - but it still returns a singleton result, containing NULL in
>with "select max(colname) from table" you query the result of an aggregate =
>
>function. so
>you get exact one! row and that you should expect!
>But, Stefan does firebird accept "select max(colname) AS rsname from table"=
>
> (with AS
>keyword)?
rsname.
This guy is really hard to convince that, if you ask a question in SQL that
returns a result, you'll get a result. Here and in support, he insists that
there should be NO result if the answer is null.
He ought to use whatever it takes to get
select (what you want) from atable
where exists (select 1 from atable)
That does both tasks in a single query, in the proper manner for SQL,
without wasting a second hit on the database.
H.