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 ma*******@postgresql.org) 9 1446
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 ma*******@postgresql.org)
---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster
|| is the string concatenation operator, so what you're doing is
equivalent to using the concatenated values of those fields.
I have no experience with ILIKE, but you might figure out yourself
what's wrong...
HTH,
Csaba.
On Thu, 2003-09-11 at 13:36, 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 ma*******@postgresql.org)
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org
|| is the string concatenation operator, so what you're doing is
equivalent to using the concatenated values of those fields.
I have no experience with ILIKE, but you might figure out yourself
what's wrong...
HTH,
Csaba.
On Thu, 2003-09-11 at 13:36, 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 ma*******@postgresql.org)
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postgresql.org
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?
No, it's string concatenation. Also, remember that NULLs are special
a || NULL is NULL. You can use coalesce(field,"") to get an empty string
if field is NULL.
1 OR 0 = 1 1 OR 1 = 1 0 OR 0 = 0 right?
And even for OR, the above isn't true in SQL because of NULLs.
1 | 0 | N
1 1 | 1 | N
0 1 | 0 | N
N N | N | N
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly
Stephan Szabo wrote: 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?
No, it's string concatenation. Also, remember that NULLs are special a || NULL is NULL. You can use coalesce(field,"") to get an empty string if field is NULL.
1 OR 0 = 1 1 OR 1 = 1 0 OR 0 = 0 right?
And even for OR, the above isn't true in SQL because of NULLs. 1 | 0 | N 1 1 | 1 | N 0 1 | 0 | N N N | N | N
THANK YOU VERY MUCH!!! ;))
that did the deed, exactly as intended!!
now I understand.
thanks again to all of you!
cheers,
alex
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
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?
No, it's string concatenation. Also, remember that NULLs are special
a || NULL is NULL. You can use coalesce(field,"") to get an empty string
if field is NULL.
1 OR 0 = 1 1 OR 1 = 1 0 OR 0 = 0 right?
And even for OR, the above isn't true in SQL because of NULLs.
1 | 0 | N
1 1 | 1 | N
0 1 | 0 | N
N N | N | N
---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly
Stephan Szabo wrote: 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?
No, it's string concatenation. Also, remember that NULLs are special a || NULL is NULL. You can use coalesce(field,"") to get an empty string if field is NULL.
1 OR 0 = 1 1 OR 1 = 1 0 OR 0 = 0 right?
And even for OR, the above isn't true in SQL because of NULLs. 1 | 0 | N 1 1 | 1 | N 0 1 | 0 | N N N | N | N
THANK YOU VERY MUCH!!! ;))
that did the deed, exactly as intended!!
now I understand.
thanks again to all of you!
cheers,
alex
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings
On Thu, 11 Sep 2003, 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?
No. Any component must not be NULL. Use coalesce("Herausgeber",'') to
ensure it's never NULL.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives? http://archives.postgresql.org
On Thu, 11 Sep 2003, 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?
No. Any component must not be NULL. Use coalesce("Herausgeber",'') to
ensure it's never NULL.
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives? http://archives.postgresql.org This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: shank |
last post by:
1) I'm getting this error: Syntax error (missing operator) in query
expression on the below statement. Can I get some advice.
2) I searched...
|
by: netpurpose |
last post by:
I need to extract data from this table to find the lowest prices of
each product as of today. The product will be listed/grouped by the
name only,...
|
by: Harvey |
last post by:
Hi,
I try to write an asp query form that lets client search any text-string and
display all pages in my web server that contain the text. I have...
|
by: Diamondback |
last post by:
I have two tables, WIDGETS and VERSIONS. The WIDGETS table has
descriptive information about the widgets while the VERSIONS table
contains IDs...
|
by: Dave Thomas |
last post by:
If I have a table set up like this:
Name | VARCHAR
Email | VARCHAR
Age | TINYINT | NULL (Default: NULL)
And I want the user to enter his or...
|
by: Dom |
last post by:
I need to run a query based on a query in Access. The second query has
a number of conditions which all work well, but there is one more
contition...
|
by: Ryan Hubbard |
last post by:
Is it possible to get the recordset from an open query window? So you
run the query. The window is open. Can vba retrieve this data?
|
by: starace |
last post by:
I have designed a form that has 5 different list boxes where the
selections within each are used as criteria in building a dynamic
query. Some...
|
by: Richard Hollenbeck |
last post by:
I tried to ask this question before on the 14th of January but I never got a
reply. I'm still struggling with the problem. I'll try to rephrase...
|
by: Bernard Lebel |
last post by:
Hello,
I'm stumbled at a serious problem, and quite frankly getting
desparate. This is a rather long-winded one so I'll try to get
straight to...
|
by: tammygombez |
last post by:
Hey everyone!
I've been researching gaming laptops lately, and I must say, they can get pretty expensive. However, I've come across some great...
|
by: better678 |
last post by:
Question:
Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct?
Answer:
Java is an object-oriented...
|
by: teenabhardwaj |
last post by:
How would one discover a valid source for learning news, comfort, and help for engineering designs? Covering through piles of books takes a lot of...
|
by: Kemmylinns12 |
last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
|
by: CD Tom |
last post by:
This only shows up in access runtime. When a user select a report from my report menu when they close the report they get a menu I've called Add-ins...
|
by: jalbright99669 |
last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
|
by: antdb |
last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine
In the overall architecture, a new "hyper-convergence" concept was...
|
by: Matthew3360 |
last post by:
Hi, I have a python app that i want to be able to get variables from a php page on my webserver. My python app is on my computer. How would I make it...
|
by: AndyPSV |
last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
| |