lundi 4 janvier 2021

join tables with a common field less the test on another condition

I want to join two tables which have a common field called "station". The first table is called fish_stations, it has a fields called station and description This table contains all stations. The second table called fish_assignments has three fields, member_name, work_date and station. I want to test the current date, called (current_date) against the variable work_date and if found the result in the output should be stations not found with the current_date.

The query statement I tried is:

Select * FROM fish_stations INNER JOIN fish_assignment ON (fish_assignment.station=fish_stations.station) WHERE fish.stations.station IS NULL and (fish_assignment.work_date=:P1/*

Can you please help me with the correct statement? Thank you!

Aucun commentaire:

Enregistrer un commentaire