|Subject||Re: [firebird-support] join question|
|Author||Svein Erling Tysvær|
Simple, just make sure you only refer to table b in the left join and not in the where clause:Select a.nrworker, b.valueworkermonth from table A left join table B on a.nrworker = b.nrworker and a.active = 1 and b.year = 2017 and b.month = 4HTH,Set2017-04-11 12:14 GMT+02:00 'Check_Mail' check_mail@... [firebird-support] <firebird-support@yahoogroups. com>:
I have a small question.
Active 0 or 1
Now I would like to get all NrWorker from Table A with Active 1 and the ValueWorkerMonth from the Table B (from the current month)
This is like
Select a.nrworker, b.valueworkermonth from table A left join table B on a.nrworker = b.nrworker where a.active = 1 and b.year = 2017 and b.month = 4
Fine, but I would like also all Worker (NrWorker from Table A) where are not present in Table B in this month.
I would like to get not only Worker 12, rather 13 and 14 too.
How can I realize it in Firebird?