Re: [SQL] 2 questions.

From: Chris Johnson <cmj(at)inline-design(dot)com>
To: Colin Dick <cdick(at)mail(dot)ocis(dot)net>
Cc: pgsql-sql(at)postgreSQL(dot)org, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: [SQL] 2 questions.
Date: 1998-09-23 12:44:49
Message-ID: Pine.LNX.4.00.9809230837320.27650-100000@boreus.bedfo.ma.tiac.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql

ALERT - cc'd to pgsql-hackers since this looks like a bug in the parser to
me.

On Tue, 22 Sep 1998, Colin Dick wrote:

> Can you do a multiple comparison on the same field. I would like to be
> able to find entries that have either a null entry or a blank entry as a
> boolean result and sort by the boolean result.

In a word Yes - it looks like the parser simply doesn't understand your
SQL and craps out on it.

> (ie: select field='' or field is null as x from table order by x;)

I write this as:

select field as x from table where field='' or field is null order by x;

which works properly (even tested it on 6.3.2). Either you aren't
supposed to write queries as you did or the parser should figure out what
you are trying to do. Either way I think it's a bug. You can resolve it
yourself by just writing the query as I did.

Chris

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Sferacarta Software 1998-09-23 13:45:53 Re: [SQL] 2 questions.
Previous Message Michael Meskes 1998-09-23 11:57:36 Recursive Unions

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Johnson 1998-09-23 12:47:09 Re: [SQL] case-insensitive SORT BY?
Previous Message Lotto 1998-09-23 12:13:20 subscribe