Home > Archive > ASE Database forum > April 2005 > Outer join









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Outer join
Charles Bonsu

2005-04-20, 8:24 pm

If I have an outer join of say
where tableA.pk *= tableB.pk
AND tableB.type_code = 'ABB'
AND tableB.atr_code NOT IN ('B','F','G')

is that bad logic or it can be done
Mark A. Parsons

2005-04-20, 8:24 pm

Do you get an error message when you submit the query?

Charles, Bonsu wrote:

> If I have an outer join of say
> where tableA.pk *= tableB.pk
> AND tableB.type_code = 'ABB'
> AND tableB.atr_code NOT IN ('B','F','G')
>
> is that bad logic or it can be done


manoj

2005-04-21, 3:24 am

TableB can not participate in any equal join.
regards
Manoj

<Charles Bonsu> wrote in message news:4266b981.410e.1681692777@sybase.com...
> If I have an outer join of say
> where tableA.pk *= tableB.pk
> AND tableB.type_code = 'ABB'
> AND tableB.atr_code NOT IN ('B','F','G')
>
> is that bad logic or it can be done



Luc Van der Veurst

2005-04-21, 7:24 am

Then use the standard outer join syntax :

select ...
from tabelA left join tableB
on tableA.pk = tableB.pk
AND tableB.type_code = 'ABB'
AND tableB.atr_code NOT IN ('B','F','G')

Luc.


"manoj" <manoj_kumar@non.agilent.com> wrote in message
news:42676004$1@foru
ms-2-dub...
> TableB can not participate in any equal join.
> regards
> Manoj
>
> <Charles Bonsu> wrote in message

news:4266b981.410e.1681692777@sybase.com...
>
>



Charles Bonsu

2005-04-21, 9:24 am

What would you suggest to still get the same result.


> TableB can not participate in any equal join.
> regards
> Manoj
>
> <Charles Bonsu> wrote in message
>
>

manoj

2005-04-21, 9:24 am

You can split the query in 2 step.
regards
Manoj

<Charles Bonsu> wrote in message news:4267b050.13c.1681692777@sybase.com...[color=darkred]
> What would you suggest to still get the same result.
>
>


Dark

2005-04-25, 7:26 am

> If I have an outer join of say
> where tableA.pk *= tableB.pk
> AND tableB.type_code = 'ABB'
> AND tableB.atr_code NOT IN ('B','F','G')
>
> is that bad logic or it can be done


Use view for tableB.atr_code NOT IN ('B','F','G')
And outher join with view

Dariusz Turek


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com