Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

join with restrictive clause

Status
Not open for further replies.

stroy

Programmer
Dec 10, 2001
11
CA
3 tables...

Languages
IdLang
Description

Expresssion
IdExp
Date


LangExpression
IdExp
IdLand
Description

I need a list of all languages with an indicator (true/false or count…)to know if the expression exist for that language for a specific expression

Language
Fr French
En English
Sp Spanish

Expression
1 10/10/10
2 10/10/10
3 10/10/10

LangExpression
1 Fr jour
1 En day
1 Sp dias
2 Fr nuit
2 En night
3 Fr rue
3 En street

I need for expression 2
FR true
EN true
SP false

If I go with joins, the “WHERE idExp = 2“ removes the SP entry from the resultset.
I use Oracle 8i.
Please help
Thanks
 
I have a solution but I am sure there must be a better way:

select a.idLANG, decode((select b.idLANG from langExpression b, langue c where b.idExp = '2' and c.idLANG = b.idLANG and b.idLANG = a.idlang), null, 'false', 'true') as ok
from langue a

Thanks
Stroy
 
I think I got it right...

select t2.idLANG, decode((select t1.idLANG from langExpression t1 where t1.idexp = '1' and t1.idLANG = t2.idlang), null, 'false', 'true')
from langue t2

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top