Subject RE: [firebird-support] work with join and null value
Author Svein Erling Tysvær
Select <whatever>
From a
Left join b on a.target = b.id
Where b.value < :threshold
Or b.id is null

-----Original Message-----
From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] On Behalf Of korkless
Sent: 8. mars 2010 11:20
To: firebird-support@yahoogroups.com
Subject: [firebird-support] work with join and null value

hi, i have this tables

Table A
{
INTEGER ID; //PK
INTEGER TARGET; //NULLABLE FK TO TABLE B
}

Table B
{
INTEGER ID; //PK
INTEGER VALUE;
}

i need to implement a store procedure with the integer THRESHOLD as parameter, in this procedure i need to select all the record of table A wich have Target NULL or where the joined table B record has VALUE < THRESHOLD.

i'm not very good in sql and i canot find a solution, can samebody help me?
thanks