Question

Help with multiple LEFT JOIN using InlineQuerier

  • 29 April 2021
  • 3 replies
  • 4 views

TABLE AHi, I have a question about how to perform a Multiple LEFT JOIN, because I need to categorize certain ROWs of my TABLE A (all the fields always have information), based on the combination of criteria that I have in TABLE B, the categories are defined in the column RESPONSIBLE TEAM of TABLE B, many of the fields in TABLE B are empty and when this is the case, it is possible to select any value (wildcard), if I do a simple LEFT JOIN it works correctly, but I can't do more than two LEFT JOIN to be able to do the categorization I need.

I am using InlineQuerier.

this is what I am using:

 

select * from "TABLE A" 

LEFT JOIN "TABLE B"

 

 

on "Country" like "_Country"

and "State" like "_State" is not null or '%'

and "City" like "_City" is not null or '%'

and "CODE" like "_CODE" is not null or '%'

and "Description" like "_Description" is not null or '%'

and "Exp Comment" like "_Exp Comment" is not null or '%'

and "Condition" like "_Condition" is not null or '%'

and "User" like "_User" is not null or '%'

 

Could you take a look and help me with this, please?

 

TABLE B


3 replies

Badge +4

Hi @diello​ ,

if I understand you right- have you tried to separete it?

 

First query

UNION ALL

Second query

Hi @diello​ ,

if I understand you right- have you tried to separete it?

 

First query

UNION ALL

Second query

Hello @connecter​ could you guide me with a small example?

Badge +4

Hello @connecter​ could you guide me with a small example?

Hello again,

I'm not a good as SQL, I often use UNION ALL to combine selects in the InlineQuerier like this:

 

select * from "TABLE A" 

LEFT JOIN "TABLE B" on "Country" like "_Country"

 

UNION ALL

 

select * from "TABLE A" 

LEFT JOIN "TABLE on "State" like "_State"  is not null or '%'

 

UNION ALL

 

select * ....

Reply