Re: query-question

From: Pavel Stehule <stehule(at)kix(dot)fsv(dot)cvut(dot)cz>
To: Alexander Blüm <mailinglists1(at)gmx(dot)de>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: query-question
Date: 2003-09-11 11:57:26
Message-ID: Pine.LNX.4.44.0309111355420.27453-100000@kix.fsv.cvut.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello

|| isn't OR!!

testdb011=> select 'aaaa'||'bbbbbbb';
?column?
-------------
aaaabbbbbbb

This is SQL, not java or C. OR is OR in SQL :->

Pavel

On Thu, 11 Sep 2003, [ISO-8859-1] Alexander Blüm wrote:

> hello,
>
> I'm facing an odd problem.
> I have a query:
>
> SELECT "Kürzel", "Autor(en)", "Titel"
> FROM "tblTitelangaben"
> WHERE "Titel"||"Kürzel"||"Monographie-Kürzel"||"Autor(en)" ILIKE '%er%';
>
> this works like a charm.
>
> but if I add another ||"something" - which might be emtpy, I get no
> results.. why?
>
> WHERE
> "Titel"||"Kürzel"||"Monographie-Kürzel"||"Autor(en)"||"Herausgeber"
> ILIKE '%er%';
>
> || is the same as "OR", is it not?
>
> 1 OR 0 = 1
> 1 OR 1 = 1
> 0 OR 0 = 0
> right?
> therefore I should get the same, or more results...
>
> any hints are greatly appreciated!
>
> TIA,
> alex
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
> (send "unregister YourEmailAddressHere" to majordomo(at)postgresql(dot)org)
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andrew L. Gould 2003-09-11 12:07:07 Re: I need a SQL...
Previous Message Alexander Blüm 2003-09-11 11:36:42 query-question