473,725 Members | 1,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

left outer join issue?

Dev

Hello all,

I need to do a left out join where a.field1 ilike %b.field2%

But I can not figure out the exact syntax to using the ilike in the join?

----------

UMPA
Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
<http://www.umpa-us.com>http://www.umpa-us.com
1-800-555-9665 ext 212

Nov 23 '05 #1
5 2296
Dev
At 02:28 PM 5/18/2004, Bruno Wolff III wrote:
On Tue, May 18, 2004 at 14:10:04 -0400,
Dev <de*@umpa-us.com> wrote:

Hello all,

I need to do a left out join where a.field1 ilike %b.field2%

But I can not figure out the exact syntax to using the ilike in the join?


Use the ON clause syntax.


Here is what it actually looks like
LEFT OUTER JOIN table4 AS d ON (a.field1 ilike "%d.field2% ") )

a is setup for table1 and it is reference in a few other left outer joins.

Those "other" outer joins work fine with out this new part

----------

UMPA
Brian C. Doyle
Director, Internet Services
United Merchant Processing Association
<http://www.umpa-us.com>http://www.umpa-us.com
1-800-555-9665 ext 212

Nov 23 '05 #2
On Tue, May 18, 2004 at 14:10:04 -0400,
Dev <de*@umpa-us.com> wrote:

Hello all,

I need to do a left out join where a.field1 ilike %b.field2%

But I can not figure out the exact syntax to using the ilike in the join?


Use the ON clause syntax.

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to ma*******@postg resql.org

Nov 23 '05 #3
On Tue, May 18, 2004 at 14:26:18 -0400,
Dev <de*@umpa-us.com> wrote:
At 02:28 PM 5/18/2004, Bruno Wolff III wrote:
On Tue, May 18, 2004 at 14:10:04 -0400,
Dev <de*@umpa-us.com> wrote:

Hello all,

I need to do a left out join where a.field1 ilike %b.field2%

But I can not figure out the exact syntax to using the ilike in the join?


Use the ON clause syntax.


Here is what it actually looks like
LEFT OUTER JOIN table4 AS d ON (a.field1 ilike "%d.field2% ") )

a is setup for table1 and it is reference in a few other left outer joins.

Those "other" outer joins work fine with out this new part


Maybe this isn't really an left join syntax question as much as
an expression syntax question. Maybe you want:
LEFT OUTER JOIN table4 AS d ON (a.field1 ilike ('%' || d.field2|| '%') )

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 23 '05 #4
on 5/18/04 12:26 PM, de*@umpa-us.com purportedly said:
At 02:28 PM 5/18/2004, Bruno Wolff III wrote:
On Tue, May 18, 2004 at 14:10:04 -0400,
Dev <de*@umpa-us.com> wrote:

Hello all,

I need to do a left out join where a.field1 ilike %b.field2%

But I can not figure out the exact syntax to using the ilike in the join?


Use the ON clause syntax.


Here is what it actually looks like
LEFT OUTER JOIN table4 AS d ON (a.field1 ilike "%d.field2% ") )

a is setup for table1 and it is reference in a few other left outer joins.

Those "other" outer joins work fine with out this new part


Your field reference is incorrect. Use concatenation:

ON (a.field1 ilike '%'||d.field2|| '%') )

Remember in Postgres, double quotes are only used to delimit identifiers.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #5
On Tuesday 18 May 2004 02:26 pm, Dev wrote:
At 02:28 PM 5/18/2004, Bruno Wolff III wrote:
On Tue, May 18, 2004 at 14:10:04 -0400,

Dev <de*@umpa-us.com> wrote:
Hello all,

I need to do a left out join where a.field1 ilike %b.field2%

But I can not figure out the exact syntax to using the ilike in the
join?


Use the ON clause syntax.


Here is what it actually looks like
LEFT OUTER JOIN table4 AS d ON (a.field1 ilike "%d.field2% ") )


Use
LEFT OUTER JOIN table4 AS d ON (a.field1 ILIKE '%' || d.field2 || '%')

-miker

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
10053
by: Dam | last post by:
Using SqlServer : Query 1 : SELECT def.lID as IdDefinition, TDC_AUneValeur.VALEURDERETOUR as ValeurDeRetour FROM serveur.Data_tblDEFINITIONTABLEDECODES def, serveur.Data_tblTABLEDECODEAUNEVALEUR TDC_AUneValeur where def.TYPEDETABLEDECODES = 4
1
4215
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins" slows the system down considerably. I've tried creating a temp db, but I can't figure out how to execute two select commands. (It throws the exception "The column prefix 'tempdb' does not match with a table name or alias name used in the query.")
7
31562
by: Steve | last post by:
I have a SQL query I'm invoking via VB6 & ADO 2.8, that requires three "Left Outer Joins" in order to return every transaction for a specific set of criteria. Using three "Left Outer Joins" slows the system down considerably. I've tried creating a temp db, but I can't figure out how to execute two select commands. (It throws the exception "The column prefix 'tempdb' does not match with a table name or alias name used in the query.")
6
9031
by: Thomas Beutin | last post by:
Hi, i've a speed problem withe the following statement: SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id FROM ot_adresse AS a, ot_produkt AS p LEFT OUTER JOIN ot_kat_prod AS pz ON ( p.p_id = pz.p_id ) WHERE p.a_id = a.id AND a.id = '105391105424941' AND a.m_id = '37'; This is terrible slow compared to the inner join: SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id
3
23098
by: Ian Boyd | last post by:
i know nothing about DB2, but i'm sure this must be possible. i'm trying to get a client to create a view (which it turns out is called a "Logical" in DB2). The query needs a LEFT OUTER JOIN, but he doesn't know how to do that, or even if he can, and i don't have to time to learn DB2 from scratch right now. The following SQL Query is a trimmed sample of the full View (i.e. Logical) definition - and i would create it on an SQL based...
14
5716
by: mike | last post by:
I'm using postgresl 7.3.2 and have a query that executes very slowly. There are 2 tables: Item and LogEvent. ItemID (an int4) is the primary key of Item, and is also a field in LogEvent. Some ItemIDs in LogEvent do not correspond to ItemIDs in Item, and periodically we need to purge the non-matching ItemIDs from LogEvent. The query is: delete from LogEvent where EventType != 'i' and ItemID in
3
17837
by: Doug | last post by:
Hi, I'm more familiar with MSSQL than Access syntax and have run into a problem with correctly putting ( )'s around the joins in a 3 table query. I want to INNER JOIN lenders and accounts and LEFT OUTER JOIN that result with prospects. (I want to receive all the results of the inner join and any pertinent info from table 3 that is available.) The way it was written in MSSQL was basically..
1
3277
by: nico3334 | last post by:
I have a query that currently pulls data from a main table and a second table using LEFT OUTER JOIN. I know how to do make another LEFT OUTER JOIN with the main table, but I want to add another LEFT OUTER JOIN to the second table. So I want the third table to be joined through the second table, not the main table. Here is my original code that joins the main table and the second table SELECT t1.supply, t2.inventory, FROM MAIN_TABLE...
1
4608
by: teneesh | last post by:
Here I have a code for a view that has been created by a developer on my team. I am trying to use the very same code to create a view for a different formid/quesid. But I cannot figure out how this one starts and ends. can someone please help. here's the code from the developer. SELECT a.EvalRecNo, w1.q1, w2.q2, w3.q3, w4.q4, w5.q5, w6.comment FROM (SELECT DISTINCT u.EvalRecNo FROM dbo.UData AS u...
0
8872
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8747
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9246
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8069
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6694
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4773
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3211
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2619
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2150
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.